]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
missing: inform the user if GNU tar is called
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 30 Oct 2011 09:30:09 +0000 (10:30 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 22 Dec 2011 11:08:49 +0000 (12:08 +0100)
* 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.

ChangeLog
lib/missing

index 92297ecfe71a3e117c31c0cd54efa14b4a9eb1fb..ec3aec105fb84f8078bb3809c10ef31a040706bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-12-22  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       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  <stefano.lattarini@gmail.com>
 
        missing: if GNU tar exists but fails when called, give up
index 411123ff75d40f62e5d0bd867a3e3a2d1b2a93ec..46f33bf075cf00a6302825a71dffa7295ca3b5ab 100755 (executable)
@@ -322,12 +322,13 @@ WARNING: \`$1' is $msg.  You should only need it if
     shift
     # 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.
-    if (gnutar --version) > /dev/null 2>&1; then
-       exec gnutar "$@"
-    fi
-    if (gtar --version) > /dev/null 2>&1; then
-       exec gtar "$@"
-    fi
+    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
     firstarg=$1
     if shift; then
        case $firstarg in