Debian Codegraph @

gnulib-local/build-aux/git-version-gen.diff

raw
1 This patch is being discussed
2 at <http://lists.gnu.org/archive/html/bug-gnulib/2012-07/msg00079.html>.
3 Remove when integrated in Gnulib.
4
5 diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
6 index bd2c4b6..4458d7d 100755
7 --- a/build-aux/git-version-gen
8 +++ b/build-aux/git-version-gen
9 @@ -86,6 +86,7 @@ Print a version string.
10 Options:
11
12 --prefix PREFIX prefix of git tags (default 'v')
13 + --match pattern for git tags to match (default: '\$prefix*')
14 --fallback VERSION
15 fallback version to use if \"git --version\" fails
16
17 @@ -97,11 +98,15 @@ Running without arguments will suffice in most cases."
18 prefix=v
19 fallback=
20
21 +unset match
22 +unset tag_sed_script
23 +
24 while test $# -gt 0; do
25 case $1 in
26 --help) echo "$usage"; exit 0;;
27 --version) echo "$version"; exit 0;;
28 --prefix) shift; prefix=${1?};;
29 + --match) shift; match="$1";;
30 --fallback) shift; fallback=${1?};;
31 -*)
32 echo "$0: Unknown option '$1'." >&2
33 @@ -125,6 +130,7 @@ if test "x$tarball_version_file" = x; then
34 exit 1
35 fi
36
37 +match="${match:-$prefix*}"
38 tag_sed_script="${tag_sed_script:-s/x/x/}"
39
40 nl='
41 @@ -155,7 +161,7 @@ then
42 # directory, and "git describe" output looks sensible, use that to
43 # derive a version string.
44 elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
45 - && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
46 + && v=`git describe --abbrev=4 --match="$match" HEAD 2>/dev/null \
47 || git describe --abbrev=4 HEAD 2>/dev/null` \
48 && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
49 && case $v in