File: mkgit_head.sh

package info (click to toggle)
virtuoso-opensource 7.2.12%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 299,308 kB
  • sloc: ansic: 655,054; sql: 508,209; xml: 269,573; java: 84,064; javascript: 79,847; cpp: 37,662; sh: 32,429; cs: 25,702; php: 12,690; yacc: 11,666; lex: 7,933; makefile: 7,308; jsp: 4,523; awk: 1,719; perl: 1,013; ruby: 1,003; python: 326
file content (20 lines) | stat: -rwxr-xr-x 453 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

VALUE=000000

if test \! -f git_head.c 
then
    echo "#define GIT_HEAD_STR \"$VALUE\"" > git_head.c
    echo "char * git_head = \"$VALUE\";" >> git_head.c
fi

VALUE=`git rev-parse --verify HEAD --short` || exit

echo "#define GIT_HEAD_STR \"$VALUE\"" > git_head.c.new
echo "char * git_head = \"$VALUE\";" >> git_head.c.new

cmp git_head.c git_head.c.new >/dev/null 2>/dev/null || mv git_head.c.new git_head.c

rm -f git_head.c.new

exit 0