forked from esrf-bliss/Lima-camera-pco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetId
28 lines (20 loc) · 1.06 KB
/
setId
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#======================================================================
# this script fails in LIMA and PROCLIB if it is run as post-commit
# .../Lima/.git/modules/camera/pco/hooks/post-commit
#
# problem related with the change to other directory during the
# git process???
# (cd ../.. ;) (cd ../../third-party/Processlib ;)
#======================================================================
FILE="./include/PcoGitVersion.h"
DT=`date +"%Y/%m/%d %H:%M:%S"`
PCOREV=`git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H]" HEAD || echo "ERROR"`
LIMAREV=`cd ../.. ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H]" HEAD || echo "ERROR"`
PROCLIBREV=`cd ../../third-party/Processlib ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H]" HEAD || echo "ERROR"`
{
echo "#define PCO_GIT_VERSION \"\$Id: PCO ${PCOREV} at [${DT}] \$\""
echo "#define LIMA_GIT_VERSION \"\$Id: LIMA ${LIMAREV} at [${DT}] \$\""
echo "#define PROCLIB_GIT_VERSION \"\$Id: PROCLIB ${PROCLIBREV} at [${DT}] \$\""
} > ${FILE}
cat ${FILE}