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

2024-03-23 Thread Bruno Haible
Collin Funk wrote: > sed -e 's,/,\\/,g' -e 's,^,/^,' -e 's,$,\$/d,' < "$tmp"/ignore-removed > if test -n "$anchor"; then sed -e 's,/,\\/,g' -e > "s,^,/^${doubly_escaped_anchor}," -e 's,$,$/d,' < "$tmp"/ignore-removed; fi > > Which uses sed expressions to create sed expressions right? Like this: >

gnulib-tool.py: Fix the modules indentation in --create-testdir' output

2024-03-23 Thread Bruno Haible
In the output of test-create-testdir4, the list of modules in the output is not correctly indented: --- test-create-testdir-4.out 2024-03-19 17:48:35.022049580 +0100 +++ tmp2229544-out 2024-03-24 01:42:30.769446029 +0100 @@ -1,3262 +1,3342 @@ Module list with included dependencies (indente

Re: gnulib-tool.py: Update TODO file

2024-03-23 Thread Collin Funk
On 3/23/24 5:01 PM, Bruno Haible wrote: > * Is os.walk() as efficient as the 'find' command? On some file systems, > determining the type (file vs. directory) of a directory entry requires > an extra stat() call; on others, it is no extra overhead. We can assume > that the 'find' command is w

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

2024-03-23 Thread Collin Funk
Hi Bruno, On 3/23/24 3:49 AM, Bruno Haible wrote: > What's still missing, is the handling of 'files_removed'. > GLImport.py lines 804..820 ought to match gnulib-tool.sh lines 6253..6273. Sorry I haven't fixed this yet. I'm pretty sure I have been overthinking this issue for the past hour or two h

gnulib-tool.sh: Use a default auxdir in --extract-automake-snippet

2024-03-23 Thread Bruno Haible
Here it's gnulib-tool.sh which produces bad output: $ diff -u <(./gnulib-tool.sh --extract-automake-snippet relocatable-prog) <(./gnulib-tool.py --extract-automake-snippet relocatable-prog) --- /dev/fd/63 2024-03-24 01:30:55.783950235 +0100 +++ /dev/fd/62 2024-03-24 01:30:55.783950235 +0100 @@

gnulib-tool.py: Don't unnecessarily sort an EXTRA_DIST augmentation

2024-03-23 Thread Bruno Haible
I see this test failure: $ GNULIB_TOOL_IMPL=py ./test-create-testdir-4.sh Files ./test-create-testdir-4.result/gllib/Makefile.am and tmp2146793-result/gllib/Makefile.am differ FAIL: gnulib-tool's result has unexpected differences. $ diff -u ./test-create-testdir-4.result/gllib/Makefile.am tmp214

Re: [PATCH] maint: Allow gnulib's readutmp module to use systemd.

2024-03-23 Thread Bruno Haible
Hi Simon and Collin, > > Could putting the following into bootstrap.conf be a method that > > we could recommend? Then developers can override it with > > GNULIB_TOOL_IMPL=sh ./bootstrap if they want. > > > > GNULIB_TOOL_IMPL=${GNULIB_TOOL_IMPL:-py} > > I'd like to hear what Bruno thinks about

Re: gnulib-tool.py: Update TODO file

2024-03-23 Thread Bruno Haible
Hi Collin, > Since one bullet point is inlining 'sed' invocations, it might also be > worth considering doing the same for 'find'. Two considerations: * Is os.walk() as efficient as the 'find' command? On some file systems, determining the type (file vs. directory) of a directory entry require

Re: [PATCH] gnulib-tool.py: Don't use --[no]-vc-files unless explicitly given.

2024-03-23 Thread Bruno Haible
Collin Funk wrote: > I've attached an updated patch. Thanks! Applied. Bruno

Re: [PATCH] maint: Allow gnulib's readutmp module to use systemd.

2024-03-23 Thread Collin Funk
Hi Simon, On 3/23/24 2:24 AM, Simon Josefsson wrote: > Is there a way to opt-in inetutils to prefer python gnulib-tool, before > gnulib as a whole changes its default behaviour? I think doing that > will allow better testing of gnulib-tool.py in the wild until gnulib as > a whole can change. Thi

Re: gnulib-tool.py: Update TODO file

2024-03-23 Thread Collin Funk
Hi Bruno, On 3/23/24 8:30 AM, Bruno Haible wrote: > So, I've trimmed and reorganized the TODO file. Thanks for checking these. I was going to mention a few of them but you beat me to it. :) Since one bullet point is inlining 'sed' invocations, it might also be worth considering doing the same fo

Re: [PATCH] gnulib-tool.py: Don't use --[no]-vc-files unless explicitly given.

2024-03-23 Thread Collin Funk
On 3/23/24 4:49 AM, Bruno Haible wrote: > If the variable has 3 possible values (None, False, True), then writing > 'if value == True:' is the simpler way. Why would one use a conversion to > bool, i.e. 3-values to 2-values conversion? It would only make things > more complicated. Yes, I agree now

gnulib-tool.py: Don't unnecessarily run configure && make in testdirs

2024-03-23 Thread Bruno Haible
Running $ GNULIB_TOOL_IMPL=py ./test-create-testdir-1.sh invokes configure, make, make distclean in the generated directory, although this is not needed. It's due to a typo ('cleaned_files' instead of 'tests_cleaned_files'). This patch fixes it. 2024-03-23 Bruno Haible gnulib-tool.py

gnulib-tool.py: Fix autoconf snippets inclusion if --single-configure

2024-03-23 Thread Bruno Haible
With the option --single-configure, gnulib-tool.py omits many autoconf snippets from the generated configure.ac: $ GNULIB_TOOL_IMPL=py ./test-create-testdir-1.sh Files ./test-create-testdir-1.result/configure.ac and tmp1933038-result/configure.ac differ FAIL: gnulib-tool's result has unexpected

gnulib-tool.py: Avoid undesired diagnostics from the 'patch' command

2024-03-23 Thread Bruno Haible
With Automake 1.16.3 in $PATH, I see this test failure: $ GNULIB_TOOL_IMPL=py ./test-create-testdir-2.sh ./test-create-testdir-2.out tmp2119378-out differ: byte 16366, line 886 --- ./test-create-testdir-2.out 2024-03-19 17:28:37.195424671 +0100 +++ tmp2119378-out 2024-03-23 18:05:58.725173290

gnulib-tool.py: Print "executing touch config.h.in"

2024-03-23 Thread Bruno Haible
This patch reduces the mismatch from GNULIB_TOOL_IMPL=py ./test-create-testdir-2.sh 2024-03-23 Bruno Haible gnulib-tool.py: Print "executing touch config.h.in". * pygnulib/GLTestDir.py (GLTestDir.execute): Print "executing touch config.h.in", like gnulib-tool.sh does.

gnulib-tool.py: Update TODO file

2024-03-23 Thread Bruno Haible
I've checked the remaining items in the TODO file: - "regex-quote: \] -> ] in EREs and BREs" Does not apply to regexes in Python syntax. => Nothing to do. - "Fix bug in func_symlink_if_changed, from 2006-11-13." The code that I committed in 2022-08 appears to handle this already.

Re: [PATCH] gnulib-tool.py: Don't use --[no]-vc-files unless explicitly given.

2024-03-23 Thread Bruno Haible
Collin Funk wrote: > I'm used to writing this: > > if value: > print('1') > else: > print('2') > > instead of this: > > if value == True: > print('1') > elif value == False: > print('2') If the variable has 2 possible values, then writing 'if value:' is the simpler way of writin

Re: [PATCH] gnulib-tool.py: Don't use --[no]-vc-files unless explicitly given.

2024-03-23 Thread Collin Funk
On 3/23/24 3:54 AM, Bruno Haible wrote: > But this part of your patch is a no-op, since > > >>> None == True > False > >>> None == False > False > > No? Oops... Yes you are right. I'm used to writing this: if value: print('1') else: print('2') instead of this: if value == Tru

Re: [PATCH] gnulib-tool.py: Don't use --[no]-vc-files unless explicitly given.

2024-03-23 Thread Bruno Haible
Hi Collin, > This patch handles some issues with --vc-files/--no--vc-files. > gnulib-tool.py would always print this in the actioncmd message at the > top of files. The proper behavior would be to check if vc_files == > None before treating it as a bool. But this part of your patch is a no-op, si

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

2024-03-23 Thread Bruno Haible
Hi Collin, > This patch should hopefully stop gnulib-tool.py from mangling > .gitignore files like it did previously. I think I did a decent job > translating the join calls into Python sets, but any criticism is > welcome. I've applied the patch, although it is incomplete. Next, I applied the a

Re: [PATCH] maint: Allow gnulib's readutmp module to use systemd.

2024-03-23 Thread Simon Josefsson via Gnulib discussion list
(moving to bug-gnulib) Collin Funk writes: > On 3/22/24 2:18 PM, Simon Josefsson wrote: >> Upgrading inetutils to use gnulib-tool.py would be nice. As a start, I >> bumped the gnulib submodule. > > Bruno and I are still working on it with a test suite. We want the > file output and stdout outpu

[PATCH] gnulib-tool.py: Don't use --[no]-vc-files unless explicitly given.

2024-03-23 Thread Collin Funk
This patch handles some issues with --vc-files/--no--vc-files. gnulib-tool.py would always print this in the actioncmd message at the top of files. The proper behavior would be to check if vc_files == None before treating it as a bool. In gnulib-tool.sh it is empty else true/false. The second issu