Debian Codegraph @

update-revision-info.sh

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3
•4 echoscip-shell system . . echo. "update-revision-info.sh not used in Debian build"
5 exit 0
6
7 FRDIR=`dirnamescip-shell system . . dirname. $0`
8 REVISIONINFOFILE=src/revisioninfo.h
9
10 # This will already contain the quotes needed in the header file
11 GITHASH="";
12 if [scip-shell system . . `[`. -x "$(command -v git 2>/dev/nullscip-shell filesystem . . `/dev/null`.)" ]; then
13 GITHASH=`gitscip-shell system . . git. log -1 --pretty=format:%h $FRDIR 2>/dev/nullscip-shell filesystem . . `/dev/null`.`
14 if [scip-shell system . . `[`. "$GITHASH" != "" ]; then
15 GITHASH="\"$GITHASH\""
16 fi
17 fi
18
19 if testscip-shell system . . test. -f $REVISIONINFOFILE ; then
20 HEADER_GITHASH=`awkscip-shell system . . awk. '/FR_GIT_HASH/ {print $3}scip-shell filesystem . . `/FR_GIT_HASH/ {print $3}`.' $REVISIONINFOFILE`
21 if [scip-shell system . . `[`. "$HEADER_GITHASH" != "$GITHASH" ]; then
22 echoscip-shell system . . echo. "git hash has changed from $HEADER_GITHASH to $GITHASH"
23 WRITE_HEADER="y"
24 fi
25 else
26 echoscip-shell system . . echo. "$REVISIONINFOFILE not found"
27 WRITE_HEADER="y"
28 fi
29
30 if [[ "$WRITE_HEADER" == "y" ]]
31 then
32 echoscip-shell system . . echo. "// auto-generated by update-revision-info script" > $REVISIONINFOFILE
33
34 if [scip-shell system . . `[`. "$GITHASH" != "" ]; then
35 echoscip-shell system . . echo. "Writing git hash $GITHASH to $REVISIONINFOFILE"
36 echoscip-shell system . . echo. "#define FR_GIT_HASH $GITHASH" >> $REVISIONINFOFILE
37 else
38 echoscip-shell system . . echo. "Writing no git hash to $REVISIONINFOFILE"
39 echoscip-shell system . . echo. "#undef FR_GIT_HASH" >> $REVISIONINFOFILE
40 fi
41 fi