Re: git repositories vs. tarballs

2024-04-14 Thread Simon Josefsson via Gnulib discussion list
Bruno Haible writes: > Hi Simon, > > In the other thread [1][2][2a], but see also [3] and [4], you are asking Hi Bruno -- thanks for attempting to bring som order to this complicated matter! I am in agreement with most of what you say, although some comments below. >> Has this changed, so we s

Re: gnulib-tool.py: Remove a redundant function.

2024-04-14 Thread Collin Funk
On 4/14/24 6:23 PM, Collin Funk wrote: > Also, I noticed we have: > > for src in old_files: > dest = self.rewrite_files([src])[-1] > old_table.append(tuple([dest, src])) > > This is looping over a list, creating a new list with one item, > calling GLImport.rewri

gnulib-tool.py: Remove a redundant function.

2024-04-14 Thread Collin Funk
The GLImport class has two functions that are the same, GLImport.rewrite_old_files() and GLImport.rewrite_new_files(). The GLImport.rewrite_old_files() function does this extra step before processing the list: files = [ '%s%s' % (file, os.path.sep) for file in files ]

git repositories vs. tarballs

2024-04-14 Thread Bruno Haible
Hi Simon, In the other thread [1][2][2a], but see also [3] and [4], you are asking > Has this changed, so we should recommend maintainers > to 'EXTRA_DIST = bootstrap bootstrap-funclib.sh bootstrap.conf' so this > is even possible? 1) I think changing the contents of a tarball ad-hoc, like this,

Re: gnulib-tool.py: Stop using codecs.open

2024-04-14 Thread Collin Funk
Hi Bruno, On 4/14/24 3:16 PM, Bruno Haible wrote: > I verified that on Cygwin, the test suite passes; this is because > - Cygwin programs produce LF as line terminator, > - Python's platform.system() returns "CYGWIN_NT-10.0". > > Regarding native Windows, I don't think there's a realistic use

Re: gnulib-tool.py: Fix incorrect type hint.

2024-04-14 Thread Bruno Haible
Collin Funk wrote: > The 'filelist' passed to > 'filter_filelist' should be marked 'list[str]' and not 'str'. Thanks, applied.

Re: gnulib-tool.py: Stop using codecs.open

2024-04-14 Thread Bruno Haible
Hi Collin, > You mentioned removing the constants.nlconvert() stuff in > an earlier email [1]. How about these two patches? I verified that on Cygwin, the test suite passes; this is because - Cygwin programs produce LF as line terminator, - Python's platform.system() returns "CYGWIN_NT-10.0".

module usage statistics

2024-04-14 Thread Bruno Haible
I went through all packages listed in users.txt, extracted the requested modules from the bootstrap.conf / gnulib-cache.m4 / ..., and stored the result in maint-tools/used-modules/. From these lists, one can make statistics. Note: The list of packages in users.txt is certainly incomplete; accordin

gnulib-tool.py: Fix incorrect type hint.

2024-04-14 Thread Collin Funk
When adding type hints I made a mistake. The 'filelist' passed to 'filter_filelist' should be marked 'list[str]' and not 'str'. You can see this in GLModuleSystem.py with mypy [1]: pygnulib/GLModuleSystem.py:595: error: Argument 2 has incompatible type "list[str]"; expected "str" [arg-type] pyg

Re: gnulib-tool.py: Remove some unused variables.

2024-04-14 Thread Bruno Haible
Hi Collin, > There are a few cases of statements like this: > > var = None > try: > # do something > var = True >except: > var = False > or: > > var = None > if other_condition: > var = True > else: > var = False

Re: gnulib-tool.py: Stop using codecs.open

2024-04-14 Thread Collin Funk
Hi Bruno, On 4/13/24 4:08 AM, Bruno Haible wrote: > It seems that codecs.open is frowned upon, nowadays [1], > and that the Python 3 way of opening a file is a built-in function 'open' [2]. Thanks for this patch. When I started working on gnulib-tool.py I didn't even know the codecs module existe

gnulib-tool.py: Remove some unused variables.

2024-04-14 Thread Collin Funk
There are a few cases of statements like this: var = None try: # do something var = True except: var = False or: var = None if other_condition: var = True else: var = False Since the 'var' will be set to a bool unc