File: rewrite_version_git.sh

package info (click to toggle)
ctwm 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,580 kB
  • sloc: ansic: 34,729; yacc: 985; sh: 466; perl: 415; lex: 133; makefile: 102
file content (16 lines) | stat: -rwxr-xr-x 373 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# Rewrite version.c.in (well, technically, stdin) with git revision info.
# We assume if we're getting called, git is available.


REVID=`git rev-parse HEAD`
if [ $? -ne 0 ]; then
	# Failed somehow
	REVID="???"
fi

# Shouldn't need sanitized like we do in bzr JIC.

# Pass stdin through and sub
sed -e "s/%%VCSTYPE%%/\"git\"/" -e "s/%%REVISION%%/\"${REVID}\"/"