bug-gnulib
[Top][All Lists]
Advanced

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

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


From: Pádraig Brady
Subject: Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 39.
Date: Sun, 3 Mar 2024 12:30:47 +0000
User-agent: Mozilla Thunderbird

On 03/03/2024 05:33, Collin Funk wrote:
On 3/2/24 7:02 PM, Collin Funk wrote:
When working on the one of the TODO entries I noticed that
the gnulib-comp.m4 output was incorrect.

Here is the item I was working on. I _think_ I understood it correctly
but you guys are much more talented at shell than me. :)

Specifically, I was a bit confused at first by the
func_emit_autoconf_snippets function. The diff showed the following
change:

-    for m in $modules; do echo $m; done | LC_ALL=C sort -u > "$tmp"/modules
+    for m in $referenceable_modules; do echo $m; done | LC_ALL=C sort -u > 
"$tmp"/modules

Which I didn't understand until seeing this line [1]:

deps=`for m in $deps; do echo $m; done | LC_ALL=C sort -u | LC_ALL=C join - 
"$tmp"/modules`

This just means that join takes stdin as its first file which is the
piped output of sort. Then the second file is the sorted
referenceable_modules stored in "$tmp"/modules right?

If I am interpreting that correctly then the lines I used would be
correct I think:

depmodules = sorted(set(depmodules).intersection(referenceable_modules))

The merge-gnulib script output seems more correct than usual, but I
could be missing something.

[1] 
https://git.savannah.gnu.org/cgit/gnulib.git/tree/gnulib-tool?id=589e96475f8f2d21a83405ab0672ce95091b80e5#n4296

Collin

Right, join without options is essentially set intersection.
See https://www.pixelbeat.org/cmdline.html#sets

cheers,
Pádraig



reply via email to

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