[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL
|
From: |
Bruno Haible |
|
Subject: |
Re: gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL |
|
Date: |
Fri, 15 Mar 2024 22:36:46 +0100 |
Yesterday I did:
> * gnulib-tool: New file, based on gnulib-tool.sh.
Here's a small improvement.
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.
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."
- Re: planning for beta-testing gnulib-tool.py, (continued)
- gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL, Bruno Haible, 2024/03/14
- Re: gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL, Bruno Haible, 2024/03/15
- Re: gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL, Bruno Haible, 2024/03/16
- Re: gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL, Bruno Haible, 2024/03/16
- Re: gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL, Collin Funk, 2024/03/16
- Re: gnulib-tool: Obey environment variable GNULIB_TOOL_IMPL,
Bruno Haible <=