From: Bruno Haible Date: Fri, 15 Mar 2024 21:36:51 +0000 (+0100) Subject: gnulib-tool: Enhance last patch. X-Git-Tag: v1.0~288 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cf0c3a42a226d6eaf3fcabe83c6472a4c1e28dbf;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 08a8276629..0822e36cc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-03-15 Bruno Haible + + 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 gnulib-tool.py: Follow gnulib-tool changes, part 57. diff --git a/gnulib-tool b/gnulib-tool index 9f353550d5..d7b6d33912 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -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."