automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-571-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-571-g26133b3
Date: Thu, 22 Dec 2011 11:51:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=26133b3bca603bde75fac88a70296e400d7673a9

The branch, maint has been updated
       via  26133b3bca603bde75fac88a70296e400d7673a9 (commit)
       via  fdc16456f45edf32aa4c4036611eb2c102fe89e5 (commit)
       via  75f2b50a655a8dc41a51c6fdcb1c6f8571dce348 (commit)
       via  a930b7d18bfd011647c84def5fef69e3880a2686 (commit)
       via  82bf2d3511ce31739156b60d51cda76e73eb6ec2 (commit)
       via  b2b375c36a960b43e9b4ace8021d37a3969126c4 (commit)
      from  7f713c38e4e1ad3c3cca73e6cd23d605ad7b886e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 26133b3bca603bde75fac88a70296e400d7673a9
Merge: fdc1645 75f2b50
Author: Stefano Lattarini <address@hidden>
Date:   Thu Dec 22 12:47:26 2011 +0100

    Merge branch 'missing-fixes' into maint
    
    * missing-fixes:
      missing: don't try to re-run tar with a munged command line
      missing: inform the user if GNU tar is called
      missing: if GNU tar exists but fails when called, give up
      missing: miscellaneous fixlets

commit fdc16456f45edf32aa4c4036611eb2c102fe89e5
Author: Stefano Lattarini <address@hidden>
Date:   Fri Dec 9 09:51:21 2011 +0100

    maint: remove executable bit from automake.in
    
    * automake.in: This file is not meant to be executed, only to
    be preprocessed to create the `automake' script; so don't leave
    it executable.

commit 75f2b50a655a8dc41a51c6fdcb1c6f8571dce348
Author: Stefano Lattarini <address@hidden>
Date:   Sun Oct 30 11:55:28 2011 +0100

    missing: don't try to re-run tar with a munged command line
    
    * lib/missing: If the default `tar' program fails with the given
    arguments, and GNU tar is not available, don't try to re-run the
    default `tar' with a munged command line (e.g., ditching possibly
    unportable options), as that could be subtly alter the intended
    semantics (and maybe even create a somewhat corrupted tarball).
    Also, it's worth noting that the main purpose of the `missing'
    script is to allow a non-developer to build the package in the
    face of slightly-skewed timestamps, not to provide wrappers for
    all the maintainer tools -- so we don't have to try too hard
    when `missing' is just called to wrap `tar'.
    * tests/missing-tar.test: New test.
    * tests/Makefile.am (TESTS): Add it.

commit a930b7d18bfd011647c84def5fef69e3880a2686
Author: Stefano Lattarini <address@hidden>
Date:   Sun Oct 30 10:30:09 2011 +0100

    missing: inform the user if GNU tar is called
    
    * lib/missing: If the code trying to run GNU tar is reached, it
    means that the previous attempt to run the default tar program
    has failed, very likely producing some error message.  At this
    point, just running GNU tar without further comments might be
    confusing.

commit 82bf2d3511ce31739156b60d51cda76e73eb6ec2
Author: Stefano Lattarini <address@hidden>
Date:   Sun Oct 30 10:12:28 2011 +0100

    missing: if GNU tar exists but fails when called, give up
    
    * lib/missing: If the code trying to run GNU tar is reached,
    don't continue if the invoked GNU tar program fails, as there
    is little point in doing so (and can even be confusing and
    counter-productive).

commit b2b375c36a960b43e9b4ace8021d37a3969126c4
Author: Stefano Lattarini <address@hidden>
Date:   Sun Oct 30 09:57:50 2011 +0100

    missing: miscellaneous fixlets
    
    * lib/missing: Some shells, such as Solaris or FreeBSD /bin/sh,
    warn about missing programs before performing redirections.
    Therefore, where we have to silently check whether a program
    exists, perform redirections on a subshell.
    Remove redundant uses of double-quotes in variable definitions.
    Delete an extra blank line.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |   50 +++++++++++++++
 lib/missing            |   43 ++++---------
 tests/Makefile.am      |    1 +
 tests/Makefile.in      |    1 +
 tests/missing-tar.test |  160 ++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 225 insertions(+), 30 deletions(-)
 mode change 100755 => 100644 automake.in
 create mode 100755 tests/missing-tar.test

diff --git a/ChangeLog b/ChangeLog
index 49b6e8b..18a0432 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+2011-12-22  Stefano Lattarini  <address@hidden>
+
+       missing: don't try to re-run tar with a munged command line
+       * lib/missing: If the default `tar' program fails with the given
+       arguments, and GNU tar is not available, don't try to re-run the
+       default `tar' with a munged command line (e.g., ditching possibly
+       unportable options), as that could be subtly alter the intended
+       semantics (and maybe even create a somewhat corrupted tarball).
+       Also, it's worth noting that the main purpose of the `missing'
+       script is to allow a non-developer to build the package in the
+       face of slightly-skewed timestamps, not to provide wrappers for
+       all the maintainer tools -- so we don't have to try too hard
+       when `missing' is just called to wrap `tar'.
+       * tests/missing-tar.test: New test.
+       * tests/Makefile.am (TESTS): Add it.
+
+2011-12-22  Stefano Lattarini  <address@hidden>
+
+       missing: inform the user if GNU tar is called
+       * lib/missing: If the code trying to run GNU tar is reached, it
+       means that the previous attempt to run the default tar program
+       has failed, very likely producing some error message.  At this
+       point, just running GNU tar without further comments might be
+       confusing.
+
+2011-12-22  Stefano Lattarini  <address@hidden>
+
+       missing: if GNU tar exists but fails when called, give up
+       * lib/missing: If the code trying to run GNU tar is reached,
+       don't continue if the invoked GNU tar program fails, as there
+       is little point in doing so (and can even be confusing and
+       counter-productive).
+
+2011-12-22  Stefano Lattarini  <address@hidden>
+
+       missing: miscellaneous fixlets
+       * lib/missing: Some shells, such as Solaris or FreeBSD /bin/sh,
+       warn about missing programs before performing redirections.
+       Therefore, where we have to silently check whether a program
+       exists, perform redirections on a subshell.
+       Remove redundant uses of double-quotes in variable definitions.
+       Delete an extra blank line.
+
+2011-12-22  Stefano Lattarini  <address@hidden>
+
+       maint: remove executable bit from automake.in
+       * automake.in: This file is not meant to be executed, only to
+       be preprocessed to create the `automake' script; so don't leave
+       it executable.
+
 2011-12-20  Peter Rosin  <address@hidden>
 
        tests: fix spurious failure on systems lacking unistd.h
diff --git a/automake.in b/automake.in
old mode 100755
new mode 100644
diff --git a/lib/missing b/lib/missing
index 28055d2..1039955 100755
--- a/lib/missing
+++ b/lib/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-12-22.11; # UTC
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <address@hidden>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -226,7 +226,7 @@ WARNING: \`$1' $msg.  You should only need it if
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
        case $LASTARG in
        *.y)
            SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -256,7 +256,7 @@ WARNING: \`$1' is $msg.  You should only need it if
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
        case $LASTARG in
        *.l)
            SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -320,32 +320,15 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   tar*)
     shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-       case $firstarg in
-       *o*)
-           firstarg=`echo "$firstarg" | sed s/o//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-       case $firstarg in
-       *h*)
-           firstarg=`echo "$firstarg" | sed s/h//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-    fi
-
+    # We have already tried tar in the generic part.  So try with GNU tar.
+    # Look for gnutar/gtar before invocation to avoid ugly error messages.
+    for cmd in gnutar gtar; do
+      ($cmd --version) > /dev/null 2>&1 || continue
+      echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         Trying to use GNU tar (\"$cmd\") instead ..."
+      exec $cmd "$@"
+    done
     echo 1>&2 "\
 WARNING: I can't seem to be able to run \`tar' with the given arguments.
          You may want to install GNU tar or Free paxutils, or check the
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 831906b..8e3c1d1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -578,6 +578,7 @@ missing3.test \
 missing4.test \
 missing5.test \
 missing6.test \
+missing-tar.test \
 mkinstall.test \
 mkinst2.test \
 mkinst3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 3ad0146..261b462 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -862,6 +862,7 @@ missing3.test \
 missing4.test \
 missing5.test \
 missing6.test \
+missing-tar.test \
 mkinstall.test \
 mkinst2.test \
 mkinst3.test \
diff --git a/tests/missing-tar.test b/tests/missing-tar.test
new file mode 100755
index 0000000..4f531df
--- /dev/null
+++ b/tests/missing-tar.test
@@ -0,0 +1,160 @@
+#! /bin/sh
+# Copyright (C) 2011 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
+# the Free Software Foundation; either version 2, 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, see <http://www.gnu.org/licenses/>.
+
+# Test how the `missing' script wraps the`tar' program .
+# FIXME: we should also try to run the `missing' script with the
+#        $CONFIG_SHELL ...
+
+. ./defs || Exit 1
+
+set -e
+
+# FIXME: make this working with "installcheck" too ...
+cp "$testsrcdir"/../lib/missing . \
+  || fatal_ "failed to fetch auxiliary script \`missing'"
+
+old_PATH=$PATH; export old_PATH
+new_PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+mkdir bin
+
+cat > data.txt <<'END'
+To be, or not to be: that is the question:
+Whether 'tis nobler in the mind to suffer
+...
+END
+
+cat > nonesuch <<'END'
+#!/bin/sh
+exit 127
+END
+chmod a+x nonesuch
+
+# Simple runs.
+for nullify_gnu in yes no; do
+  case $nullify_gnu in
+    yes)
+      cp nonesuch bin/gtar
+      cp nonesuch bin/gnutar
+      PATH=$new_PATH; export PATH;
+      mkdir simple-nognu
+      cd simple-nognu
+      ;;
+    no)
+      mkdir simple-dflt
+      cd simple-dflt
+      ;;
+    *)
+      Exit 99 # Can't happen.
+      ;;
+  esac
+  cp ../data.txt foobar.txt
+  ../missing --run tar cvf mu.tar foobar.txt
+  rm -f foobar.txt
+  test -f mu.tar
+  ../missing --run tar tf mu.tar >output 2>&1 || { cat output; Exit 1; }
+  cat output
+  $FGREP 'foobar.txt' output
+  test ! -f foobar.txt
+  ../missing --run tar xvf mu.tar
+  diff ../data.txt foobar.txt
+  PATH=$old_PATH; export PATH;
+  cd ..
+done
+
+rm -f bin/*
+
+# Helper scripts and functions for next tests.
+
+cat > fake-gnu-tar <<'END'
+#!/bin/sh
+case " $* " in *\ --version\ *) echo fake GNU tar; exit $?;; esac
+PATH=$old_PATH; export PATH
+exec tar "$@"
+END
+chmod a+x fake-gnu-tar
+
+cat > failing-tar <<'END'
+#!/bin/sh
+echo "Error message from tar passed through" >&2
+exit 1
+END
+chmod a+x failing-tar
+
+grep_tar_failed ()
+{
+  grep "WARNING:.* can't.* run \`tar' with .*given arguments" $*
+}
+
+# The `tar' program does not work with the given options, but we have
+# gtar or gnutar.
+cp failing-tar bin/tar
+for pfx in g gnu; do
+  case $pfx in g) othpfx=gnu;; gnu) othpfx=g;; *) Exit 99;; esac
+  cp nonesuch bin/${othpfx}tar
+  if ${pfx}tar --version | grep GNU; then :; else
+    cp fake-gnu-tar bin/${pfx}tar
+  fi
+  tarball=foo-$pfx.tar
+  PATH=$new_PATH; export PATH
+  ./missing --run tar cvf $tarball ./data.txt 2>stderr \
+    || { cat stderr >&2; Exit 1; }
+  cat stderr >&2
+  PATH=$old_PATH; export PATH
+  test -f $tarball
+  grep_tar_failed stderr
+  grep "Error message from tar passed through" stderr
+  grep "[Tt]rying to use GNU tar.*${pfx}tar" stderr
+  grep "${othpfx}tar" stderr && Exit 1
+  : # For shells with broken 'set -e'
+done
+
+rm -f bin/*
+
+# The `tar' program does not work with the given options, and we don't
+# have neither gtar nor gnutar.
+cp failing-tar bin/tar
+cp nonesuch bin/gtar
+cp nonesuch bin/gnutar
+PATH=$new_PATH; export PATH
+./missing --run tar cvf foo.tar ./data.txt 2>stderr \
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+PATH=$old_PATH; export PATH
+test ! -f foo.tar
+grep_tar_failed stderr
+grep "Error message from tar passed through" stderr
+grep "[iI]nstall GNU tar or Free [pP]axutils" stderr
+$EGREP "(g|gnu)tar" stderr && Exit 1
+
+rm -f bin/*
+
+# We try to use an option that causes any `tar' program (GNU or non-GNU) to.
+sh -x ./missing --run tar --bad-unknonw-option cvf foo.tar ./data.txt 2>stderr 
\
+  && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+test ! -f foo.tar
+grep_tar_failed stderr
+grep "bad-unknonw-option" stderr
+for p in gtar gnutar; do
+  if $p --version; then
+    cnt=1
+  else
+    cnt=0
+  fi
+  test `$EGREP -c "[Tt]rying to use GNU tar.*$p" stderr` -eq $cnt
+done
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]