Merge commit 'a39d4083cab589d7cd6a13e8a4b8db8875261d75'
[gnulib.git] / gnulib-tool
index 878f272..13aac1a 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
 # 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
@@ -323,12 +323,13 @@ q
     version=' '`cd "$gnulib_dir" && ./build-aux/git-version-gen /dev/null | sed -e 's/-dirty/-modified/'`
   else
     # gnulib copy without versioning information.
-    date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog`
-    version=
+    date=`zcat /usr/share/doc/gnulib/changelog.gz | sed -e 's/ .*//;q'`
+    version=`zcat /usr/share/doc/gnulib/NEWS.stable.gz | grep -o -m 1 ' [0-9]\+-stable'`
+    debversion=`dpkg-query --show --showformat '${Version}' gnulib`
   fi
   year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed -e 's,^.* ,,'`
   echo "\
-gnulib-tool (GNU $package $date)$version
+gnulib-tool (GNU $package $date)$version Debian: $debversion
 Copyright (C) $year Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
@@ -453,7 +454,7 @@ func_gnulib_dir ()
       * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
     esac
   done
-  gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
+  gnulib_dir=/usr/share/gnulib
 }
 
 # func_tmpdir
@@ -898,6 +899,9 @@ if test "X$1" = "X--no-reexec"; then
   shift
 fi
 
+# Unset CDPATH.  Otherwise, output from 'cd dir' can surprise callers.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
 # Command-line option processing.
 # Removes the OPTIONS from the arguments. Sets the variables:
 # - mode            one of: list, find, import, add-import, remove-import,
@@ -3334,7 +3338,7 @@ func_emit_lib_Makefile_am ()
     if test -n "$uses_subdirs"; then
       subdir_options=' subdir-objects'
     fi
-    echo "AUTOMAKE_OPTIONS = 1.5 gnits${subdir_options}"
+    echo "AUTOMAKE_OPTIONS = 1.9.6 gnits${subdir_options}"
   fi
   echo
   if test -z "$makefile_name"; then
@@ -3643,7 +3647,7 @@ func_emit_tests_Makefile_am ()
   if test -n "$uses_subdirs"; then
     subdir_options=' subdir-objects'
   fi
-  echo "AUTOMAKE_OPTIONS = 1.5 foreign${subdir_options}"
+  echo "AUTOMAKE_OPTIONS = 1.9.6 foreign${subdir_options}"
   echo
   if $for_test && ! $single_configure; then
     echo "ACLOCAL_AMFLAGS = -I ${testsbase_inverse}/${m4base}"
@@ -5888,7 +5892,7 @@ func_create_testdir ()
   # Create Makefile.am.
   (echo "## Process this file with automake to produce Makefile.in."
    echo
-   echo "AUTOMAKE_OPTIONS = 1.5 foreign"
+   echo "AUTOMAKE_OPTIONS = 1.9.6 foreign"
    echo
    echo "SUBDIRS = $subdirs"
    echo
@@ -6197,7 +6201,7 @@ func_create_megatestdir ()
   # Create Makefile.am.
   (echo "## Process this file with automake to produce Makefile.in."
    echo
-   echo "AUTOMAKE_OPTIONS = 1.5 foreign"
+   echo "AUTOMAKE_OPTIONS = 1.9.6 foreign"
    echo
    echo "SUBDIRS = $megasubdirs"
    echo