]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Enhance last patch.
authorBruno Haible <bruno@clisp.org>
Fri, 15 Mar 2024 21:36:51 +0000 (22:36 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 15 Mar 2024 21:37:40 +0000 (22:37 +0100)
* gnulib-tool: If gnulib-tool.sh failed but gnulib-tool.py succeeded,
report that and don't erase the outputs and log files.

ChangeLog
gnulib-tool

index 08a827662992f6faf30bdeb224ffae07a12ba241..0822e36cc44fb7588788b4f2dd2bc15f95e0f168 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-03-15  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Enhance last patch.
+       * gnulib-tool: If gnulib-tool.sh failed but gnulib-tool.py succeeded,
+       report that and don't erase the outputs and log files.
+
 2024-03-14  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Follow gnulib-tool changes, part 57.
index 9f353550d5c5b3d597098c581e574580f092d98b..d7b6d3391257f494dc237f34c12a0c3c3ed4be1d 100755 (executable)
@@ -179,10 +179,14 @@ case "$GNULIB_TOOL_IMPL" in
         "$gnulib_dir/gnulib-tool.sh" "$@" >"$tmp-sh-out" 2>"$tmp-sh-err"
         shrc=$?
         if test $shrc != 0; then
-          cat "$tmp-sh-out"
-          cat "$tmp-sh-err" >&2
-          rm -rf "$tmp" "$tmp-sh-out" "$tmp-sh-err" "$tmp-py-out" "$tmp-py-err"
-          exit $shrc
+          if test $pyrc = 0; then
+            func_fatal_error "gnulib-tool.sh failed but gnulib-tool.py succeeded! Inspect $tmp-sh-err and $tmp-py-err."
+          else
+            cat "$tmp-sh-out"
+            cat "$tmp-sh-err" >&2
+            rm -rf "$tmp" "$tmp-sh-out" "$tmp-sh-err" "$tmp-py-out" "$tmp-py-err"
+            exit $shrc
+          fi
         fi
         if test $pyrc != 0; then
           func_fatal_error "gnulib-tool.sh succeeded but gnulib-tool.py failed! Inspect $tmp/ and $tmp-py-err."
@@ -218,10 +222,14 @@ case "$GNULIB_TOOL_IMPL" in
         "$gnulib_dir/gnulib-tool.sh" "$@" >"$tmp-sh-out" 2>"$tmp-sh-err"
         shrc=$?
         if test $shrc != 0; then
-          cat "$tmp-sh-out"
-          cat "$tmp-sh-err" >&2
-          rm -rf "$tmp" "$tmp-sh-out" "$tmp-sh-err" "$tmp-py-out" "$tmp-py-err"
-          exit $shrc
+          if test $pyrc = 0; then
+            func_fatal_error "gnulib-tool.sh failed but gnulib-tool.py succeeded! Inspect $tmp-sh-err and $tmp-py-err."
+          else
+            cat "$tmp-sh-out"
+            cat "$tmp-sh-err" >&2
+            rm -rf "$tmp" "$tmp-sh-out" "$tmp-sh-err" "$tmp-py-out" "$tmp-py-err"
+            exit $shrc
+          fi
         fi
         if test $pyrc != 0; then
           func_fatal_error "gnulib-tool.sh succeeded but gnulib-tool.py failed! Inspect $tmp/ and $tmp-py-err."
@@ -248,10 +256,14 @@ case "$GNULIB_TOOL_IMPL" in
         "$gnulib_dir/gnulib-tool.sh" "$@" >"$tmp-sh-out" 2>"$tmp-sh-err"
         shrc=$?
         if test $shrc != 0; then
-          cat "$tmp-sh-out"
-          cat "$tmp-sh-err" >&2
-          rm -rf "$tmp-sh-out" "$tmp-sh-err" "$tmp-py-out" "$tmp-py-err"
-          exit $shrc
+          if test $pyrc = 0; then
+            func_fatal_error "gnulib-tool.sh failed but gnulib-tool.py succeeded! Inspect $tmp-sh-err and $tmp-py-err."
+          else
+            cat "$tmp-sh-out"
+            cat "$tmp-sh-err" >&2
+            rm -rf "$tmp-sh-out" "$tmp-sh-err" "$tmp-py-out" "$tmp-py-err"
+            exit $shrc
+          fi
         fi
         if test $pyrc != 0; then
           func_fatal_error "gnulib-tool.sh succeeded but gnulib-tool.py failed! Inspect $tmp-py-err."