automake-patches
[Top][All Lists]
Advanced

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

[FYI 3/4] {maint} missing: inform the user if GNU tar is called


From: Stefano Lattarini
Subject: [FYI 3/4] {maint} missing: inform the user if GNU tar is called
Date: Thu, 22 Dec 2011 12:48:20 +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   |    9 +++++++++
 lib/missing |   13 +++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 92297ec..ec3aec1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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
diff --git a/lib/missing b/lib/missing
index 411123f..46f33bf 100755
--- a/lib/missing
+++ b/lib/missing
@@ -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
-- 
1.7.7.3




reply via email to

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