possible to use binary --version or -v to get the branch and versionid

This commit is contained in:
Dhanya Maliakal
2017-12-06 19:05:35 +01:00
parent c4a242e10a
commit bf9905ad2a
10 changed files with 130 additions and 105 deletions

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware
URL: origin git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git
Repository Root: origin git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git
Repsitory UUID: b498043ea612fa3148bf1d7ea2a39c46092addf8
Revision: 1627
Repsitory UUID: c4a242e10a4aafd102cc9a2a7ddae4ac92b8ba99
Revision: 1629
Branch: 3.0.1
Last Changed Author: Dhanya_Maliakal
Last Changed Rev: 3185
Last Changed Date: 2017-12-06 08:43:21.000000002 +0100 ./slsDetector/slsDetectorUtils.h
Last Changed Rev: 3187
Last Changed Date: 2017-12-06 19:00:50.000000002 +0100 ./threadFiles/ThreadPool.o

View File

@ -1,6 +1,6 @@
#define GITURL "git@git.psi.ch:sls_detectors_software/slsDetectorPackage.git"
#define GITREPUUID "b498043ea612fa3148bf1d7ea2a39c46092addf8"
#define GITREPUUID "c4a242e10a4aafd102cc9a2a7ddae4ac92b8ba99"
#define GITAUTH "Dhanya_Maliakal"
#define GITREV 0x3185
#define GITREV 0x3187
#define GITDATE 0x20171206
#define GITBRANCH "blabla"
#define GITBRANCH "3.0.1"

View File

@ -1,4 +1,5 @@
#include "multiSlsDetectorClient.h"
#include "gitInfoLib.h"
#include <stdlib.h>
@ -7,6 +8,15 @@ using namespace std;
int main(int argc, char *argv[])
{
for (int i = 1; i < argc; ++i ) {
if (!(strcmp (argv[i],"--version")) || !(strcmp (argv[i],"-v"))) {
int64_t tempval = GITREV;
tempval = (tempval <<32) | GITDATE;
cout << argv[0] << " " << GITBRANCH << " (0x" << hex << tempval << ")" << endl;
return 0;
}
}
#ifdef PUT
int action=slsDetectorDefs::PUT_ACTION;
#endif

View File

@ -20,9 +20,9 @@ OLDDATE=$(more $INCLFILE | grep '#define GITDATE' | awk '{print $3}')
#update INCLFILE if changes
if [ "$OLDDATE" != "$NEWDATE" ]; then
#if [ "$OLDDATE" != "$NEWDATE" ]; then
echo Path: ${MAINDIR}/${SPECDIR} $'\n'URL: ${GITREPO} $'\n'Repository Root: ${GITREPO} $'\n'Repsitory UUID: ${REPUID} $'\n'Revision: ${FOLDERREV} $'\n'Branch: ${BRANCH} $'\n'Last Changed Author: ${AUTH1}_${AUTH2} $'\n'Last Changed Rev: ${REV} $'\n'Last Changed Date: ${RDATE} > gitInfo.txt
cd ..
./genVersionHeader.sh $SPECDIR/gitInfo.txt $SPECDIR/$TMPFILE $SPECDIR/$INCLFILE
cd $WD
fi
#fi