Skip to content

Commit

Permalink
incremented version number to 1.5.0, and it now saves git revision to…
Browse files Browse the repository at this point in the history
… fits header
  • Loading branch information
rjderosa committed Oct 1, 2019
1 parent 00b910a commit c0cad3f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 45 deletions.
61 changes: 25 additions & 36 deletions backbone/gpi_pipeline_version.pro
Original file line number Diff line number Diff line change
Expand Up @@ -50,52 +50,41 @@
; 2015-03-17 Release 1.3.0
; 2016-06-14 Release 1.4.0
; 2016-08-11 added /git option
; 2019-10-01 Release 1.5.0
;-

function gpi_pipeline_version, svn=svn, git=git
function gpi_pipeline_version

version = '1.4.0'
version = '1.5.0'

codepath = gpi_get_directory('GPI_DRP_DIR')


if keyword_set(svn) then begin
; append svn version ID also, if possible
codepath = gpi_get_directory('GPI_DRP_DIR')

if file_test(codepath+path_sep()+".svn",/directory) and ~lmgr(/runtime) then begin
cd, curr=curr
catch, myerror
if myerror eq 0 then begin
cd, codepath
spawn, 'svnversion', results,/noshell
svnid = results[n_elements(results)-1] ; take the last line of the result
; this is in case we get multi-line output because e.g. the user
version += ", rev "+strc(svnid)
endif
cd, curr
; append svn version ID also, if possible
if file_test(codepath+path_sep()+".svn",/directory) and ~lmgr(/runtime) then begin
cd, curr=curr
catch, myerror
if myerror eq 0 then begin
cd, codepath
spawn, 'svnversion', results,/noshell
svnid = results[n_elements(results)-1] ; take the last line of the result
; this is in case we get multi-line output because e.g. the user
version += ", rev "+strc(svnid)
endif

cd, curr
endif

if keyword_set(git) then begin
; append git short SHA hash also, if possible
codepath = gpi_get_directory('GPI_DRP_DIR')

if file_test(codepath+path_sep()+".git",/directory) and ~lmgr(/runtime) then begin
cd, curr=curr
catch, myerror
if myerror eq 0 then begin
cd, codepath
spawn, 'git rev-parse --short HEAD', results
svnid = results[n_elements(results)-1] ; take the last line of the result
version += ", rev "+strc(svnid)
endif
cd, curr
; append git short SHA hash also, if possible
if file_test(codepath+path_sep()+".git",/directory) and ~lmgr(/runtime) then begin
cd, curr=curr
catch, myerror
if myerror eq 0 then begin
cd, codepath
spawn, 'git rev-parse --short HEAD', results
svnid = results[n_elements(results)-1] ; take the last line of the result
version += ", rev "+strc(svnid)
endif

cd, curr
endif



return, version
end
12 changes: 6 additions & 6 deletions backbone/gpipipelinebackbone__define.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
;------------------------------------------------------------

pro gpipipelinebackbone::aboutmessage
ver = gpi_pipeline_version(/svn)
ver = gpi_pipeline_version()
nspaces = 30 - strlen(ver)
spaces = strmid(' ',0,nspaces) ; is there a better way to do this?

Expand All @@ -35,8 +35,8 @@ pro gpipipelinebackbone::aboutmessage
print, " * *"
print, " * By the GPI Data Analysis Team *"
print, " * *"
print, " * Perrin, Maire, Ingraham, Savransky, Doyon, *"
print, " * Chilcote, Draper, Fitzgerald, Greenbaum *"
print, " * Perrin, Maire, Ingraham, Savransky, De Rosa *"
print, " * Doyon, Chilcote, Draper, Fitzgerald, Greenbaum *"
print, " * Hibon, Konopacky, Long, Marois, Marchis *"
print, " * Millar-Blanchaer, Nielsen, Pueyo, *"
print, " * Ruffio, Sadakuni, Wang, Wolff, & Wiktorowicz *"
Expand Down Expand Up @@ -114,7 +114,7 @@ FUNCTION gpipipelinebackbone::Init, session=session, verbose=verbose, nogui=nog
if ~(keyword_set(self.nogui)) then begin
self->SetupStatusConsole
self.statuswindow->display_log,"* GPI DATA REDUCTION PIPELINE *"
self.statuswindow->display_log,"* VERSION "+gpi_pipeline_version(/svn)+" *"
self.statuswindow->display_log,"* VERSION "+gpi_pipeline_version()+" *"
self.statuswindow->set_calibdir, self.GPICalDB->get_calibdir()
endif

Expand Down Expand Up @@ -847,7 +847,7 @@ FUNCTION gpiPipelineBackbone::load_FITS_file, indexFrame
; is required.
;SXADDPAR, *(*self.data).HeadersExt[IndexFrame], "END",''

self->set_keyword, "HISTORY", "Reduction with GPI Data Pipeline version "+gpi_pipeline_version(/svn)
self->set_keyword, "HISTORY", "Reduction with GPI Data Pipeline version "+gpi_pipeline_version()
self->set_keyword, "HISTORY", " Started On " + SYSTIME(0)
self->set_keyword, "HISTORY", " User: "+getenv('USER')+ " Hostname: "+getenv('HOST')
return, OK
Expand Down Expand Up @@ -986,7 +986,7 @@ PRO gpiPipelineBackbone::OpenLog
OPENW, new_LUN, LogFile, /GET_LUN,/APPEND
self.LOG_GENERAL = new_LUN
PRINTF, self.LOG_GENERAL, '--------------------------------------------------------------'
PRINTF, self.LOG_GENERAL, ' GPI Data Reduction Pipeline, version '+gpi_pipeline_version(/svn)
PRINTF, self.LOG_GENERAL, ' GPI Data Reduction Pipeline, version '+gpi_pipeline_version()
PRINTF, self.LOG_GENERAL, ' Started On ' + SYSTIME(0)
PRINTF, self.LOG_GENERAL, ' User: '+user+ " Hostname: "+computer
PRINTF, self.LOG_GENERAL, ''
Expand Down
2 changes: 1 addition & 1 deletion gpitv/gpitv__define.pro
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@ pro GPItv::topmenu_event, event
'Developer Guide': gpi_open_help,'developers/gpitv_devel.html'

'About': begin
tmpstr=['GPItv Version: '+strc(gpi_pipeline_version(/svn)), $
tmpstr=['GPItv Version: '+strc(gpi_pipeline_version()), $
'', $
'GPItv is a modified version of the package ATV written by Aaron Barth.',$
'http://www.physics.uci.edu/~barth/atv/',$
Expand Down
2 changes: 1 addition & 1 deletion utils/gpi_compiler.pro
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ message,/info, "Now cleaning up and organizing the output files..."

; compute version string including major+minor version number and svn revision
; ID if possible.
version_parts = strsplit(gpi_pipeline_version(/svn),', :',/extract)
version_parts = strsplit(gpi_pipeline_version(),', :',/extract)
if n_elements(version_parts) eq 1 then version_string = version_parts[0] else version_string = version_parts[0]+"_r"+version_parts[2]


Expand Down
2 changes: 1 addition & 1 deletion utils/gpi_drp_about_message.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

function gpi_drp_about_message

ver=(gpi_pipeline_version(/git))
ver=(gpi_pipeline_version())
tmpstr=['GPI Data Reduction Pipeline Version: '+ver, $
'', $
'Copyright 2008-2016, by the GPI Team & AURA', $
Expand Down

0 comments on commit c0cad3f

Please sign in to comment.