Remove git-version-gen's first parameter.
authorJim Meyering <meyering@redhat.com>
Mon, 22 Oct 2007 19:43:12 +0000 (21:43 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 22 Oct 2007 19:43:12 +0000 (21:43 +0200)
* build-aux/git-version-gen: Add comments.
Remove first command-line parameter.
* configure.ac: Remove corresponding first argument.
* GNUmakefile (_curr-ver): Likewise.

ChangeLog
GNUmakefile
build-aux/git-version-gen
configure.ac

index 8915aec..49e5174 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-10-22  Jim Meyering  <meyering@redhat.com>
+
+       Remove git-version-gen's first parameter.
+       * build-aux/git-version-gen: Add comments.
+       Remove first command-line parameter.
+       * configure.ac: Remove corresponding first argument.
+       * GNUmakefile (_curr-ver): Likewise.
+
 2007-10-21  Jim Meyering  <meyering@redhat.com>
 
        * NEWS: Mention the printf fix.
index c5678b4..e270e63 100644 (file)
@@ -45,7 +45,7 @@ include Makefile
 ifeq (0,$(MAKELEVEL))
   _is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
   ifneq (,$(_is-dist-target))
-    _curr-ver := $(shell build-aux/git-version-gen .version)
+    _curr-ver := $(shell build-aux/git-version-gen .version)
     ifneq ($(_curr-ver),$(VERSION))
       $(info INFO: rerunning autoconf for new version string: $(_curr-ver))
       dummy := $(shell rm -rf autom4te.cache; $(AUTOCONF))
index a3e95ac..c433c26 100755 (executable)
@@ -1,14 +1,18 @@
 #!/bin/sh
 # Print a version string.
 # 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
-    2) ;;
-    *) echo 1>&2 "Usage: $0 \$VERSION \$srcdir/.version"; exit 1;;
+    1) ;;
+    *) echo 1>&2 "Usage: $0 \$srcdir/.version"; exit 1;;
 esac
 
-default_version=$1
-tarball_version_file=$2
+tarball_version_file=$1
 nl='
 '
 
@@ -41,7 +45,7 @@ then
     # Remove the "g" in git-describe's output string.
     v=`echo "$v" | sed 's/\(.*\)-g/\1-/'`;
 else
-    v=$default_version
+    v=UNKNOWN
 fi
 
 v=`echo "$v" |sed 's/^v//'`
index d97e44e..a685c95 100644 (file)
@@ -23,7 +23,7 @@ AC_PREREQ(2.61)
 # Make inter-release version strings look like, e.g., v6.9-219-g58ddd, which
 # indicates that it is built from the 219th delta (in _some_ repository)
 # following the v6.9 tag, and that 58ddd is a prefix of the commit SHA1.
-AC_INIT([GNU coreutils], m4_esyscmd([build-aux/git-version-gen 6.9+ .version]),
+AC_INIT([GNU coreutils], m4_esyscmd([build-aux/git-version-gen .version]),
        [bug-coreutils@gnu.org])
 
 AC_CONFIG_SRCDIR(src/ls.c)