-
Notifications
You must be signed in to change notification settings - Fork 9
/
setId
executable file
·85 lines (64 loc) · 3.1 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/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"
SDK_WIN_H="./sdkPco/PcoSdkVersion.h"
SDK_LIN_H="./sdkPcoLin/include/PcoSdkVersion.h"
LOG="./doc/VERSION.log"
DT=`date +"%Y/%m/%d %H:%M:%S"`
PCO_DIR=`pwd`
LIMA_DIR="${PCO_DIR}/../.."
DIR="${PCO_DIR}"
PCOREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
PCOPATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}"
LIMAREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
LIMAPATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/third-party/Processlib"
PROCLIBREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
PROCLIBPATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/third-party/bitshuffle"
BITSHUFFLEREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
BITSHUFFLEPATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/third-party/hdf5"
HDF5REV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
HDF5PATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/third-party/libconfig"
LIBCONFIGREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
LIBCONFIPATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/applications/tango/python"
TANGOREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
TANGOPATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/applications/spec"
SPECREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
SPECPATH=`cd ${DIR} ; pwd`
{
head -1 ${SDK_WIN_H}
head -1 ${SDK_LIN_H}
echo "#define PCO_GIT_VERSION \"\$Id: PCO ${PCOREV} at [${DT}] [${PCOPATH}] \$\""
echo "#define LIMA_GIT_VERSION \"\$Id: LIMA ${LIMAREV} at [${DT}] [${LIMAPATH}] \$\""
echo "#define PROCLIB_GIT_VERSION \"\$Id: PROCLIB ${PROCLIBREV} at [${DT}] [${PROCLIBPATH}] \$\""
echo "#define LIBCONFIG_GIT_VERSION \"\$Id: LIBCONFIG ${LIBCONFIGREV} at [${DT}] [${LIBCONFIGPATH}] \$\""
echo "#define HDF5_GIT_VERSION \"\$Id: HDF5 ${HDF5REV} at [${DT}] [${HDF5PATH}] \$\""
echo "#define BITSHUFFLE_GIT_VERSION \"\$Id: BITSHUFFLE ${BITSHUFFLEREV} at [${DT}] [${BITSHUFFLEPATH}] \$\""
echo "#define TANGO_GIT_VERSION \"\$Id: TANGO ${TANGOREV} at [${DT}] [${TANGOPATH}] \$\""
echo "#define SPEC_GIT_VERSION \"\$Id: SPEC ${SPECREV} at [${DT}] [${SPECPATH}] \$\""
} > ${FILE}
cat ${FILE}
{
echo
echo
date "+%Y/%m/%d %H:%M:%S =========================================="
cat ${FILE}
echo
echo
cat ${LOG}
} > ${LOG}.bck.bck
cp -f ${LOG} ${LOG}.bck
mv -f ${LOG}.bck.bck ${LOG}