mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-29 00:10:21 +02:00
Temporarily use git-version-gen from gnulib
This commit is contained in:
parent
e9538ef69b
commit
543ec017ef
1 changed files with 10 additions and 15 deletions
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Print a version string.
|
# Print a version string.
|
||||||
scriptversion=2012-12-31.23; # UTC
|
scriptversion=2016-05-08.18; # UTC
|
||||||
|
|
||||||
# Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -85,9 +85,9 @@ Print a version string.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
--prefix prefix of git tags (default 'v')
|
--prefix PREFIX prefix of git tags (default 'v')
|
||||||
--match pattern for git tags to match (default: '\$prefix*')
|
--fallback VERSION
|
||||||
--fallback fallback version to use if \"git --version\" fails
|
fallback version to use if \"git --version\" fails
|
||||||
|
|
||||||
--help display this help and exit
|
--help display this help and exit
|
||||||
--version output version information and exit
|
--version output version information and exit
|
||||||
|
@ -97,16 +97,12 @@ Running without arguments will suffice in most cases."
|
||||||
prefix=v
|
prefix=v
|
||||||
fallback=
|
fallback=
|
||||||
|
|
||||||
unset match
|
|
||||||
unset tag_sed_script
|
|
||||||
|
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--help) echo "$usage"; exit 0;;
|
--help) echo "$usage"; exit 0;;
|
||||||
--version) echo "$version"; exit 0;;
|
--version) echo "$version"; exit 0;;
|
||||||
--prefix) shift; prefix="$1";;
|
--prefix) shift; prefix=${1?};;
|
||||||
--match) shift; match="$1";;
|
--fallback) shift; fallback=${1?};;
|
||||||
--fallback) shift; fallback="$1";;
|
|
||||||
-*)
|
-*)
|
||||||
echo "$0: Unknown option '$1'." >&2
|
echo "$0: Unknown option '$1'." >&2
|
||||||
echo "$0: Try '--help' for more information." >&2
|
echo "$0: Try '--help' for more information." >&2
|
||||||
|
@ -129,7 +125,6 @@ if test "x$tarball_version_file" = x; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
match="${match:-$prefix*}"
|
|
||||||
tag_sed_script="${tag_sed_script:-s/x/x/}"
|
tag_sed_script="${tag_sed_script:-s/x/x/}"
|
||||||
|
|
||||||
nl='
|
nl='
|
||||||
|
@ -160,7 +155,7 @@ then
|
||||||
# directory, and "git describe" output looks sensible, use that to
|
# directory, and "git describe" output looks sensible, use that to
|
||||||
# derive a version string.
|
# derive a version string.
|
||||||
elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
|
elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
|
||||||
&& v=`git describe --abbrev=4 --match="$match" HEAD 2>/dev/null \
|
&& v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
|
||||||
|| git describe --abbrev=4 HEAD 2>/dev/null` \
|
|| git describe --abbrev=4 HEAD 2>/dev/null` \
|
||||||
&& v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
|
&& v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
|
||||||
&& case $v in
|
&& case $v in
|
||||||
|
@ -220,12 +215,12 @@ if test "x$v_from_git" != x; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
|
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
|
||||||
echo "$v" | tr -d "$nl"
|
printf %s "$v"
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC"
|
# time-stamp-time-zone: "UTC0"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue