1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-17 00:56:34 +02:00

Get git-version-gen from gnulib.

* build-aux/git-version-gen: Remove file.
* build-aux/.gitignore: Add git-version-gen.
* bootstrap.conf (gnulib_modules): Add git-version-gen.
This commit is contained in:
Jim Meyering
2007-11-05 08:31:51 +01:00
parent 4c9b376271
commit b8da93bee9
4 changed files with 11 additions and 95 deletions

View File

@@ -1,3 +1,10 @@
2007-11-05 Jim Meyering <meyering@redhat.com>
Get git-version-gen from gnulib.
* build-aux/git-version-gen: Remove file.
* build-aux/.gitignore: Add git-version-gen.
* bootstrap.conf (gnulib_modules): Add git-version-gen.
2007-11-03 Jim Meyering <meyering@redhat.com>
git-version-gen: Sync from autoconf's version.

View File

@@ -53,7 +53,9 @@ gnulib_modules="
ftello
fts getdate getgroups gethrxtime
getline getloadavg getndelim2 getopt getpagesize getpass-gnu
gettext gettime gettimeofday getugroups getusershell gnupload
gettext gettime gettimeofday getugroups getusershell
git-version-gen
gnupload
group-member hard-locale hash hash-pjw host-os human idcache
inttostr inttypes isapipe
lchmod lchown lib-ignore linebuffer link-follow

View File

@@ -4,6 +4,7 @@ config.guess
config.rpath
config.sub
depcomp
git-version-gen
gnupload
install-sh
link-warning.h

View File

@@ -1,94 +0,0 @@
#!/bin/sh
# Print a version string.
scriptversion=2007-11-03.22
# Copyright (C) 2007 Free Software Foundation
#
# 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
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
# It may be run two ways:
# - from a git repository in which the git-describe command below
# produces useful output (thus requiring at least one signed tag)
# - from a non-git-repo directory containing a .version file, which
# presumes this script is invoked like "./git-version-gen .version".
case $# in
1) ;;
*) echo 1>&2 "Usage: $0 \$srcdir/.version"; exit 1;;
esac
tarball_version_file=$1
nl='
'
# First see if there is a tarball-only version file.
# then try git-describe, then default.
if test -f $tarball_version_file
then
v=`cat $tarball_version_file` || exit 1
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
*) v= ;;
esac
test -z "$v" \
&& echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
fi
if test -n "$v"
then
: # use $v
elif test -d .git \
&& v=`git describe --abbrev=4 HEAD 2>/dev/null` \
&& case $v in
# FIXME: remove this after v6.10.
COREUTILS-[0-9]*) v=`echo "$v" | sed 's/^COREUTILS-//;s/_/./g'` ;;
v[0-9]*) ;;
*) (exit 1) ;;
esac
then
# Change the first '-' to a '.', so version-comparing tools work properly.
# Remove the "g" in git-describe's output string, to save a byte.
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
else
v=UNKNOWN
fi
v=`echo "$v" |sed 's/^v//'`
# Don't declare a version "dirty" merely because a time stamp has changed.
git-status > /dev/null 2>&1
dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
case "$dirty" in
'') ;;
*) # Append the suffix only if there isn't one already.
case $v in
*-dirty) ;;
*) v="$v-dirty" ;;
esac ;;
esac
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
echo "$v" | tr -d '\012'
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End: