bug-gnulib
[Top][All Lists]
Advanced

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

Re: Best way to solve this diff between gnulib-tool and gnulib-tool.py?


From: Bruno Haible
Subject: Re: Best way to solve this diff between gnulib-tool and gnulib-tool.py?
Date: Sat, 02 Mar 2024 11:18:04 +0100

Hi Collin,

> $ gnulib-tool --create-testdir --dir test-shell fts
> $ gnulib-tool.py --create-testdir --dir test-python fts
> $ git diff --no-index test-python/gltests/Makefile.am 
> test-shell/gltests/Makefile.am
> 
> Gives lots of lines like this:
> 
> -EXTRA_DIST += macros.h signature.h test-ftruncate.c test-ftruncate.sh
> +EXTRA_DIST += test-ftruncate.c test-ftruncate.sh signature.h macros.h
> 
> It seems that the Python version sorts the files in
> GLModule.getAutomakeSnippet_Unconditional and the shell script doesn't
> in func_get_automake_snippet_unconditional.

Indeed. When we look at the output regarding module 'lock-tests', it is

  EXTRA_DIST += test-rwlock1.c test-lock.c test-once.c atomic-int-gnulib.h 
macros.h

(i.e. the natural order, from modules/lock-tests) in test-shell, but

  EXTRA_DIST += atomic-int-gnulib.h macros.h test-lock.c test-once.c 
test-rwlock1.c

(i.e. sorted alphabetically) in test-python.

> Either one of the diff's below should fix the discrepancy. I'm not
> sure which one would be preferred though.

The output needs to be deterministic; the natural order from the module
description is perfectly fine. Therefore the sorting in the Python code should
go away.

Hmm, what about duplicate file names? They are harmless in EXTRA_DIST. If, say,
I list test-lock.c twice, the result is

  EXTRA_DIST += test-rwlock1.c test-lock.c test-lock.c test-once.c 
atomic-int-gnulib.h macros.h

in test-shell, but

  EXTRA_DIST += atomic-int-gnulib.h macros.h test-lock.c test-once.c 
test-rwlock1.c

in test-python. So, the effect of the line

      extra_files = sorted(set(extra_files))

is not only to sort, but also to remove duplicates. But this is not needed 
either.

Bruno






reply via email to

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