bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 48.


From: Collin Funk
Subject: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 48.
Date: Fri, 8 Mar 2024 21:47:30 -0800
User-agent: Mozilla Thunderbird

Here is a patch removing one more item from gnulib-tool.py.TODO. Here
is a test and diff before applying this patch:

gnulib-tool.py --create-testdir --dir test-python dummy
gnulib-tool --create-testdir --dir test-shell dummy
git diff --no-index test-python test-shell

diff --git a/test-python/build-aux/test-driver 
b/test-shell/build-aux/test-driver
index be73b80adf..8b6ec6c4f8 100755
--- a/test-python/build-aux/test-driver
+++ b/test-shell/build-aux/test-driver
@@ -109,7 +109,10 @@ trap "st=143; $do_exit" 15
 # to ameliorate tests themselves also writing to the log file. Our tests
 # don't, but others can (automake bug#35762).
 : >"$log_file"
-"$@" >>"$log_file" 2>&1
+case "$1" in
+  *.sh) sh "$@" >>"$log_file" 2>&1 ;;
+  *)    "$@" >>"$log_file" 2>&1 ;;
+esac

These lines are fixed by this patch on my updated GNU/Linux machine. I
saw another TODO item referencing a separate patch needed for
test-driver distributed with a specific version of Automake. I'll get
around that one in a bit, but I figured I'd mention it in case this
test fails due to that issue.

Also, mostly a note for myself, I noticed a nice readability change
that is probably worth making in the future once gnulib-tool.py is
functionally working. It seems that Python added enums after
gnulib-tool.py was originally written [1]. It would be pretty simple
to add these to GLError.py.

I think that something like

    raise GLError(GLErrno.PATCH_FAILED, 'message')

would be more readable than

    raise GLError(20, 'message')

Sort of like errno.h but without the portability issues. :)

[1] https://docs.python.org/3/library/enum.html

Collin

Attachment: 0001-gnulib-tool.py-Follow-gnulib-tool-changes-part-48.patch
Description: Text Data


reply via email to

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