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

2024-03-09 Thread Collin Funk
On 3/9/24 6:28 PM, Collin Funk wrote:
> I think that should be a pretty easy change so I will try to get it
> done sometime today.

Not the cleanest code I have ever written but it seems to work. :)

Here is a test case:

gnulib-tool.py --create-testdir --dir test-python dummy
gnulib-tool --create-testdir --dir test-shell dummy
# Copied from Coreutils configure.ac
sed -i -e 's/AM_INIT_AUTOMAKE/AM_INIT_AUTOMAKE([1.11.2 dist-xz color-tests 
parallel-tests subdir-objects])/g' test-python/configure.ac 
test-shell/configure.ac
(cd test-python && gnulib-tool.py --import --automake-subdir --with-tests 
alloca-opt alloca)
(cd test-shell && gnulib-tool --import --automake-subdir --with-tests 
alloca-opt alloca)
git diff --no-index test-python test-shell

Now gnulib-tool.py will see subdir-objects in Coreutil's configure.ac.
It still fails to bootstrap because of the @NMD@ magic:

autoreconf: running: automake --add-missing --copy --force-missing
lib/gnulib.mk:2011: error: bad characters in variable name '@!NMD@gl_V_at'
Makefile.am:212:   'lib/local.mk' included from here
lib/local.mk:1:   'lib/gnulib.mk' included from here
gnulib-tests/gnulib.mk:1384: error: bad characters in variable name 
'@!NMD@gl_V_at'
gnulib-tests/Makefile.am:1:   'gnulib-tests/gnulib.mk' included from here
autoreconf: error: automake failed with exit status: 1
./bootstrap: autoreconf failed

I don't remember those changes looking too hard, so _hopefully_ I can
get them done soon.

CollinFrom 081643519481b02362cbc5a9530e13aba2bfcb9b Mon Sep 17 00:00:00 2001
From: Collin Funk 
Date: Sat, 9 Mar 2024 20:05:10 -0800
Subject: [PATCH 2/2] gnulib-tool.py: Follow gnulib-tool changes, part 52.

Follow gnulib-tool change
2021-12-15  Bruno Haible  
automake-subdir support: Look for 'subdir-objects' also in configure.ac.

* pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects'
in the AM_INIT_AUTOMAKE macro of configure.ac.
---
 ChangeLog|  9 +
 gnulib-tool.py.TODO  | 11 ---
 pygnulib/GLImport.py | 12 ++--
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f13d759bb4..8dda625922 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-09  Collin Funk  
+
+	gnulib-tool.py: Follow gnulib-tool changes, part 52.
+	Follow gnulib-tool change
+	2021-12-15  Bruno Haible  
+	automake-subdir support: Look for 'subdir-objects' also in configure.ac.
+	* pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects'
+	in the AM_INIT_AUTOMAKE macro of configure.ac.
+
 2024-03-09  Collin Funk  
 
 	gnulib-tool.py: Follow gnulib-tool changes, part 51.
diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO
index 51e6cd9e18..e6c94c8bb8 100644
--- a/gnulib-tool.py.TODO
+++ b/gnulib-tool.py.TODO
@@ -305,17 +305,6 @@ Date:   Sun Dec 19 12:49:16 2021 +0100
 
 
 
-commit b8124d982f454b8526b5e11934a2f71faac2b600
-Author: Bruno Haible 
-Date:   Wed Dec 15 21:49:41 2021 +0100
-
-automake-subdir support: Look for 'subdir-objects' also in configure.ac.
-
-* gnulib-tool: Look for the automake options also in the first argument
-of the AM_INIT_AUTOMAKE invocation in configure.ac.
-
-
-
 commit 4b071c115309079528db7b60e8d2ffb22b129088
 Author: Paul Eggert 
 Date:   Mon Apr 26 23:31:29 2021 -0700
diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 2ebad91da5..ed0139fe3c 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -260,9 +260,17 @@ class GLImport(object):
 self.config.setModules(modules)
 
 if self.config['automake_subdir']:
-found_subdir_objects = False
+automake_options = set()
+if self.config['configure_ac']:
+pattern = re.compile(r'^.*AM_INIT_AUTOMAKE\([\[ ]*([^\]\)]*).*$', re.MULTILINE)
+with open(self.config['configure_ac'], encoding='utf-8') as file:
+data = file.read()
+configure_ac_automake_options = pattern.findall(data)
+if configure_ac_automake_options:
+automake_options = {x for y in configure_ac_automake_options for x in y.split()}
+found_subdir_objects = 'subdir-objects' in automake_options
 base = self.config['destdir'] if self.config['destdir'] else '.'
-if isfile(joinpath(base, 'Makefile.am')):
+if not found_subdir_objects and isfile(joinpath(base, 'Makefile.am')):
 pattern = re.compile(r'^AUTOMAKE_OPTIONS[\t| ]*=(.*)$', re.MULTILINE)
 with open(joinpath(base, 'Makefile.am'), encoding='utf-8') as file:
 data = file.read()
-- 
2.44.0



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

2024-03-09 Thread Collin Funk
I've implemented the initial support for --automake-subdir in
gnulib-tool.py. It is a larger patch so let me know if you have any
questions. Here is a script that I used for testing:

gnulib-tool.py --create-testdir --dir test-python dummy
gnulib-tool --create-testdir --dir test-shell dummy

sed -i -e 's/AUTOMAKE_OPTIONS = 1.11 foreign/AUTOMAKE_OPTIONS = 1.11 foreign 
subdir-objects/g' \
test-python/Makefile.am test-shell/Makefile.am
(cd test-python && gnulib-tool.py --import --automake-subdir --with-tests 
alloca-opt alloca)
(cd test-shell && gnulib-tool --import --automake-subdir --with-tests 
alloca-opt alloca)

git diff --no-index test-python test-shell

I tried to bootstrap in coreutils with this change just to see how
much is left to finish, but I have to finish another TODO item first.
Coreutils uses:

   AM_INIT_AUTOMAKE([subdir-objects])

in configure.ac instead of:

   AUTOMAKE_OPTIONS = subdir-objects

in Makefile.am.

I think that should be a pretty easy change so I will try to get it
done sometime today.

CollinFrom 9de14a0336819bf5eac7c083615e8f54094ce76b Mon Sep 17 00:00:00 2001
From: Collin Funk 
Date: Sat, 9 Mar 2024 18:12:53 -0800
Subject: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 51.

Follow gnulib-tool change
2021-12-15  Bruno Haible  
Accommodate non-recursive Automake in a less hacky way.

* pygnulib/GLConfig.py (GLConfig.__init__): Add 'automake_subdir' to the
parameter list.
(GLConfig.default): Set the default value of automake_subdir to a
boolean False.
(GLConfig.getAutomakeSubdir, GLConfig.setAutomakeSubdir)
(GLConfig.resetAutomakeSubdir): New functions to access and manipulate
the automake_subdir option.
* pygnulib/GLEmiter.py (GLEmiter.shellvars_init): New function.
(GLEmiter.initmacro_end): Add second parameter 'gentests'. Use it to prefix each
object file name in *_LIBOBJS and *_LTLIBOBJS.
* pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Add new
error for if --automake-subdir is used without the 'subdir-objects'
Automake option.
* pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects'
in Makefile.am.
(GLImport.actioncmd): Emit --automake-subdir in actioncmd.
(GLImport.gnulib_cache): Add gl_AUTOMAKE_SUBDIR to gnulib-cache.m4 if
--automake-subdir is used.
(GLImport.gnulib_comp): Update calls to GLEmiter.initmacro_end. Call
GLEmiter.shellvars_init.
(GLImport.execute): Likewise. Use the build-aux/prefix-gnulib-mk script.
* pygnulib/GLInfo.py (GLInfo.usage): Add --automake-subdir to the usage
message.
* pygnulib/GLTestDir.py (GLTestDir.execute): Update calls to
GLEmiter.initmacro_end. Call GLEmiter.shellvars_init.
* pygnulib/main.py (main): Add support for --automake-subdir.
---
 ChangeLog | 33 +
 gnulib-tool.py.TODO   | 28 
 pygnulib/GLConfig.py  | 29 ++---
 pygnulib/GLEmiter.py  | 29 ++---
 pygnulib/GLError.py   |  4 
 pygnulib/GLImport.py  | 36 +---
 pygnulib/GLInfo.py|  5 -
 pygnulib/GLTestDir.py | 14 +++---
 pygnulib/main.py  | 11 +++
 9 files changed, 144 insertions(+), 45 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3c3a8cfb96..f13d759bb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+2024-03-09  Collin Funk  
+
+	gnulib-tool.py: Follow gnulib-tool changes, part 51.
+	Follow gnulib-tool change
+	2021-12-15  Bruno Haible  
+	Accommodate non-recursive Automake in a less hacky way.
+	* pygnulib/GLConfig.py (GLConfig.__init__): Add 'automake_subdir' to the
+	parameter list.
+	(GLConfig.default): Set the default value of automake_subdir to a
+	boolean False.
+	(GLConfig.getAutomakeSubdir, GLConfig.setAutomakeSubdir)
+	(GLConfig.resetAutomakeSubdir): New functions to access and manipulate
+	the automake_subdir option.
+	* pygnulib/GLEmiter.py (GLEmiter.shellvars_init): New function.
+	(GLEmiter.initmacro_end): Add second parameter 'gentests'. Use it to prefix each
+	object file name in *_LIBOBJS and *_LTLIBOBJS.
+	* pygnulib/GLError.py (GLError.__init__, GLError.__repr__): Add new
+	error for if --automake-subdir is used without the 'subdir-objects'
+	Automake option.
+	* pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects'
+	in Makefile.am.
+	(GLImport.actioncmd): Emit --automake-subdir in actioncmd.
+	(GLImport.gnulib_cache): Add gl_AUTOMAKE_SUBDIR to gnulib-cache.m4 if
+	--automake-subdir is used.
+	(GLImport.gnulib_comp): Update calls to GLEmiter.initmacro_end. Call
+	GLEmiter.shellvars_init.
+	(GLImport.execute): Likewise. Use the build-aux/prefix-gnulib-mk script.
+	* pygnulib/GLInfo.py (GLInfo.usage): Add --automake-subdir to the usage
+	message.
+	* pygnulib/GLTestDir.py (GLTestDir.execute): Update calls to
+	GLEmiter.initmacro_end. Call GLEmiter.shellvars_init.
+	* pygnulib/main.py (main): Add support for --automake-subdir.
+
 2024-03-09  Collin Funk  
 
 	gnulib-tool.py: Follow gnulib-tool changes, part 50.

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

2024-03-09 Thread Bruno Haible
Hi Collin,

> Assuming that there are no other issues with this patch

There are no issues :)

> can you check
> the commit message and ChangeLog entry before pushing? I noticed that
> the ChangeLog entry disagrees with the git log and gnulib-tool.py.TODO
> for one of the commits. I'm new to the ChangeLog stuff so I will let
> you decide which is more useful to reference.

When there is a mistake in a ChangeLog and 'git log' entry, we can only
change the ChangeLog a posteriori, not the 'git log' entry.

> Here is the commit it was changed:
> 
> $ git  diff eed8d6e1b4924b0a7e93905871094909ba0118a3 
> eed8d6e1b4924b0a7e93905871094909ba0118a3^

This is a reverse diff. I prefer to look at

$ git diff eed8d6e1b4924b0a7e93905871094909ba0118a3^ 
eed8d6e1b4924b0a7e93905871094909ba0118a3

This makes it clear that the text in the ChangeLog should be used.

> I'm still learning how gnulib-tool works so I'm not sure how to get
> 'tests=lib/alloca.c' in "$tmp"/new-files to test the second
> conditional [1]. Feel free to let me know if there is an easy way to
> do it.

I think you did it correctly. In the function rewrite_new_files, it can
happen that a file starts with 'tests=lib/'. In GLImport.py line 967,
you can see that this file argument is stored as second element of a tuple
that later gets added to filetable['new'].

Bruno






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

2024-03-09 Thread Bruno Haible
> > another TODO item referencing a separate patch needed for
> > test-driver distributed with a specific version of Automake. ...
> 
> Patch for this attached as promised.

Thanks; applied.

Bruno






unistr/u16-to-u32: Relicense under LGPLv2+

2024-03-09 Thread Bruno Haible
I need a few libunistring modules under LGPLv2+:
  lib/unistr/u16-to-u32.c
  lib/unistr/u16-mbtoucr.c
  lib/unistr/u16-strlen.c
Since I am the only contributor of copyright-significant changes to these files,
I can do the license change directly.


2024-03-09  Bruno Haible  

unistr/u16-to-u32: Relicense under LGPLv2+.
* modules/unistr/u16-to-u32 (License): Change to LGPLv2+.
* lib/unistr/u16-to-u32.c: Update license notice.

unistr/u16-mbtoucr: Relicense under LGPLv2+.
* modules/unistr/u16-mbtoucr (License): Change to LGPLv2+.
* lib/unistr/u16-mbtoucr.c: Update license notice.

unistr/u16-strlen: Relicense under LGPLv2+.
* modules/unistr/u16-strlen (License): Change to LGPLv2+.
* lib/unistr/u16-strlen.c: Update license notice.

>From 487dbc40a2ff2b1a84e654a3bd0fbca4d5170cd5 Mon Sep 17 00:00:00 2001
From: Bruno Haible 
Date: Sat, 9 Mar 2024 13:23:47 +0100
Subject: [PATCH 1/3] unistr/u16-strlen: Relicense under LGPLv2+.

* modules/unistr/u16-strlen (License): Change to LGPLv2+.
* lib/unistr/u16-strlen.c: Update license notice.
---
 ChangeLog |  6 ++
 lib/unistr/u16-strlen.c   | 24 
 modules/unistr/u16-strlen |  2 +-
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 66926b4268..175bcf39a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-03-09  Bruno Haible  
+
+	unistr/u16-strlen: Relicense under LGPLv2+.
+	* modules/unistr/u16-strlen (License): Change to LGPLv2+.
+	* lib/unistr/u16-strlen.c: Update license notice.
+
 2024-03-09  Bruno Haible  
 
 	parse-datetime: Simplify.
diff --git a/lib/unistr/u16-strlen.c b/lib/unistr/u16-strlen.c
index d6db917086..5ef212ec03 100644
--- a/lib/unistr/u16-strlen.c
+++ b/lib/unistr/u16-strlen.c
@@ -2,26 +2,18 @@
Copyright (C) 1999, 2002, 2006, 2009-2024 Free Software Foundation, Inc.
Written by Bruno Haible , 2002.
 
-   This file is free software.
-   It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
-   You can redistribute it and/or modify it under either
- - the terms of the GNU Lesser General Public License as published
-   by the Free Software Foundation, either version 3, or (at your
-   option) any later version, or
- - the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (at your option)
-   any later version, or
- - the same dual license "the GNU LGPLv3+ or the GNU GPLv2+".
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
 
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License and the GNU General Public License
-   for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Lesser General Public
-   License and of the GNU General Public License along with this
-   program.  If not, see .  */
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see .  */
 
 #include 
 
diff --git a/modules/unistr/u16-strlen b/modules/unistr/u16-strlen
index 44fa320078..9bc5b61589 100644
--- a/modules/unistr/u16-strlen
+++ b/modules/unistr/u16-strlen
@@ -20,7 +20,7 @@ Include:
 "unistr.h"
 
 License:
-LGPLv3+ or GPLv2+
+LGPLv2+
 
 Maintainer:
 all
-- 
2.34.1

>From e521e3090b7a8e1fd2409a621b3a54e1f74c8f5d Mon Sep 17 00:00:00 2001
From: Bruno Haible 
Date: Sat, 9 Mar 2024 13:28:06 +0100
Subject: [PATCH 2/3] unistr/u16-mbtoucr: Relicense under LGPLv2+.

* modules/unistr/u16-mbtoucr (License): Change to LGPLv2+.
* lib/unistr/u16-mbtoucr.c: Update license notice.
---
 ChangeLog  |  4 
 lib/unistr/u16-mbtoucr.c   | 24 
 modules/unistr/u16-mbtoucr |  2 +-
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 175bcf39a8..847add61f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2024-03-09  Bruno Haible  
 
+	unistr/u16-mbtoucr: Relicense under LGPLv2+.
+	* modules/unistr/u16-mbtoucr (License): Change to LGPLv2+.
+	* lib/unistr/u16-mbtoucr.c: Update license notice.
+
 	unistr/u16-strlen: Relicense under LGPLv2+.
 	* modules/unistr/u16-strlen (License): Change to LGPLv2+.
 	* lib/unistr/u16-strlen.c: Update license notice.
diff --git a/lib/unistr/u16-mbtoucr.c b/lib/unistr/u16-mbtoucr.c
index 7a0ff452c7..b034022799 100644
--- a/lib/unistr/u16-mbtoucr.c
+++ b/lib/unistr/u16-mbtoucr.c
@@ 

parse-datetime: Simplify

2024-03-09 Thread Bruno Haible
These two patches simplify the 'parse-datetime' module:

- Since the module requires Bison, and the Bison-generated parser does not
  use the return value of the yyerror() function, this function can just as
  well return 'void'.

- The Makefile rules for generating two files from a single .y file are
  complicated. But the .h file generated by bison is not needed. We can
  tell Bison to generate only a .c file; this simplifies the Makefile rules.


2024-03-09  Bruno Haible  

parse-datetime: Simplify.
* modules/parse-datetime (Makefile.am): Don't generate
parse-datetime-gen.h.

2024-03-09  Bruno Haible  

parse-datetime: Simplify.
* lib/parse-datetime.y (yyerror): Change return type to 'void'.

>From 005d84d6597a1c0ac607466144c29a81f168cf2c Mon Sep 17 00:00:00 2001
From: Bruno Haible 
Date: Sat, 9 Mar 2024 12:45:06 +0100
Subject: [PATCH 1/2] parse-datetime: Simplify.

* lib/parse-datetime.y (yyerror): Change return type to 'void'.
---
 ChangeLog| 5 +
 lib/parse-datetime.y | 5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 10de1262c3..6fed81caa6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-03-09  Bruno Haible  
+
+	parse-datetime: Simplify.
+	* lib/parse-datetime.y (yyerror): Change return type to 'void'.
+
 2024-03-09  Collin Funk  
 
 	gnulib-tool.py: Follow gnulib-tool changes, part 48.
diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
index b833055a8c..447a943db1 100644
--- a/lib/parse-datetime.y
+++ b/lib/parse-datetime.y
@@ -244,7 +244,7 @@ debugging (parser_control const *pc)
 
 union YYSTYPE;
 static int yylex (union YYSTYPE *, parser_control *);
-static int yyerror (parser_control const *, char const *);
+static void yyerror (parser_control const *, char const *);
 static bool time_zone_hhmm (parser_control *, textint, intmax_t);
 
 /* Extract into *PC any date and time info from a string of digits
@@ -1539,11 +1539,10 @@ yylex (union YYSTYPE *lvalp, parser_control *pc)
 }
 
 /* Do nothing if the parser reports an error.  */
-static int
+static void
 yyerror (_GL_UNUSED parser_control const *pc,
  _GL_UNUSED char const *s)
 {
-  return 0;
 }
 
 /* If *TM0 is the old and *TM1 is the new value of a struct tm after
-- 
2.34.1

>From 0ae976a99440496655971dacce5ae0e77cd32150 Mon Sep 17 00:00:00 2001
From: Bruno Haible 
Date: Sat, 9 Mar 2024 13:00:28 +0100
Subject: [PATCH 2/2] parse-datetime: Simplify.

* modules/parse-datetime (Makefile.am): Don't generate
parse-datetime-gen.h.
---
 ChangeLog  |  6 ++
 modules/parse-datetime | 31 ---
 2 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6fed81caa6..66926b4268 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-03-09  Bruno Haible  
+
+	parse-datetime: Simplify.
+	* modules/parse-datetime (Makefile.am): Don't generate
+	parse-datetime-gen.h.
+
 2024-03-09  Bruno Haible  
 
 	parse-datetime: Simplify.
diff --git a/modules/parse-datetime b/modules/parse-datetime
index 60ac0b0824..1645660abe 100644
--- a/modules/parse-datetime
+++ b/modules/parse-datetime
@@ -45,35 +45,20 @@ Makefile.am:
 # Additionally, here we assume GNU Bison and therefore don't need the ylwrap
 # script.
 # Therefore we override this rule.
-# Since this is a rule that produces multiple files, we apply the idiom from
-# , so that
-# it works also in parallel 'make'.
-generate-parse-datetime:
-	$(AM_V_YACC)$(PARSE_DATETIME_BISON) -d $(YFLAGS) $(AM_YFLAGS) $(srcdir)/parse-datetime.y \
+parse-datetime.c: parse-datetime.y
+	$(AM_V_YACC)$(PARSE_DATETIME_BISON) $(YFLAGS) $(AM_YFLAGS) $(srcdir)/parse-datetime.y \
 	&& test ':' = '$(PARSE_DATETIME_BISON)' || { \
 	  sed -e 's|".*/parse-datetime\.y"|"parse-datetime.y"|' \
 	  -e 's|"parse-datetime\.tab\.c"|"parse-datetime.c"|' \
-	  -e 's|"parse-datetime\.tab\.h"|"parse-datetime-gen.h"|' \
 	  < parse-datetime.tab.c > parse-datetime.c-tmp \
-	  && sed -e 's|".*/parse-datetime\.y"|"parse-datetime.y"|' \
-	 -e 's|"parse-datetime\.tab\.h"|"parse-datetime-gen.h"|' \
-	 < parse-datetime.tab.h > parse-datetime-gen.h-tmp \
-	  && rm -f parse-datetime.tab.c parse-datetime.tab.h \
-	  && mv parse-datetime.c-tmp $(srcdir)/parse-datetime.c \
-	  && mv parse-datetime-gen.h-tmp $(srcdir)/parse-datetime-gen.h; \
+	  && rm -f parse-datetime.tab.c \
+	  && mv parse-datetime.c-tmp $(srcdir)/parse-datetime.c; \
 	}
-.PHONY: generate-parse-datetime
-# The above rule will generate files with time stamp order
-# parse-datetime.y <= parse-datetime.c <= parse-datetime-gen.h.
-parse-datetime.c: parse-datetime.y
-	@{ test -f $(srcdir)/parse-datetime.c && test ! $(srcdir)/parse-datetime.c -ot $(srcdir)/parse-datetime.y; } || $(MAKE) generate-parse-datetime
-parse-datetime-gen.h: parse-datetime.c
-	@{ test -f $(srcdir)/parse-datetime-gen.h && test ! $(

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

2024-03-09 Thread Collin Funk
Hi Bruno,

Assuming that there are no other issues with this patch, can you check
the commit message and ChangeLog entry before pushing? I noticed that
the ChangeLog entry disagrees with the git log and gnulib-tool.py.TODO
for one of the commits. I'm new to the ChangeLog stuff so I will let
you decide which is more useful to reference.

Here is the commit it was changed:

$ git  diff eed8d6e1b4924b0a7e93905871094909ba0118a3 
eed8d6e1b4924b0a7e93905871094909ba0118a3^
diff --git a/ChangeLog b/ChangeLog
index 986cfb1ddd..370cd98398 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,7 +10,7 @@
 
 2021-12-12  Bruno Haible  
 
-   gnulib-tool: Try to support non-recursive-gnulib-prefix-hack with tests.
+   gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests.
* gnulib-tool (func_import): Synthesize an AC_CONFIG_LIBOBJ_DIR
invocation.
* m4/non-recursive-gnulib-prefix-hack.m4

Here is a test case for this patch:

gnulib-tool.py --create-testdir --dir test-python dummy
gnulib-tool --create-testdir --dir test-shell dummy
(cd test-python && gnulib-tool.py --import --with-tests alloca-opt alloca)
(cd test-shell && gnulib-tool --import --with-tests alloca-opt alloca)
git diff --no-index test-python/m4/gnulib-comp.m4 test-shell/m4/gnulib-comp.m4

This diff is fixed by the patch:

diff --git a/test-python/m4/gnulib-comp.m4 b/test-shell/m4/gnulib-comp.m4
index 82773fffde..ac6e4d0b7b 100644
--- a/test-python/m4/gnulib-comp.m4
+++ b/test-shell/m4/gnulib-comp.m4
@@ -51,6 +51,7 @@ AC_DEFUN([gl_EARLY],
 # "Check for header files, types and library functions".
 AC_DEFUN([gl_INIT],
 [
+  AC_CONFIG_LIBOBJ_DIR([lib])

I'm still learning how gnulib-tool works so I'm not sure how to get
'tests=lib/alloca.c' in "$tmp"/new-files to test the second
conditional [1]. Feel free to let me know if there is an easy way to
do it.

[1] https://git.savannah.gnu.org/cgit/gnulib.git/tree/gnulib-tool#n6044

CollinFrom 7d04cbcec2363a646d83b3012584edba538d97b6 Mon Sep 17 00:00:00 2001
From: Collin Funk 
Date: Sat, 9 Mar 2024 01:41:02 -0800
Subject: [PATCH 3/3] gnulib-tool.py: Follow gnulib-tool changes, part 50.

Follow gnulib-tool changes
2021-12-12  Bruno Haible  
gnulib-tool: Try to support non-recursive-gnulib-prefix-hack with tests.
2021-12-13  Bruno Haible  
gnulib-tool: Fix mistake in last commit.

* pygnulib/GLImport.py (GLImport.gnulib_comp): Expect the filetable as a
parameter instead of a list of all files. Add type checks. Invoke
AC_CONFIG_LIBOBJ_DIR based on the location of alloca.c.
(GLImport.execute): Adjust call to GLImport.gnulib_comp to reflect
parameter changes.
---
 ChangeLog| 14 ++
 gnulib-tool.py.TODO  | 20 
 pygnulib/GLImport.py | 28 
 3 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca39bbc532..b4dc53aca7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-03-09  Collin Funk  
+
+	gnulib-tool.py: Follow gnulib-tool changes, part 50.
+	Follow gnulib-tool changes
+	2021-12-12  Bruno Haible  
+	gnulib-tool: Try to support non-recursive-gnulib-prefix-hack with tests.
+	2021-12-13  Bruno Haible  
+	gnulib-tool: Fix mistake in last commit.
+	* pygnulib/GLImport.py (GLImport.gnulib_comp): Expect the filetable as a
+	parameter instead of a list of all files. Add type checks. Invoke
+	AC_CONFIG_LIBOBJ_DIR based on the location of alloca.c.
+	(GLImport.execute): Adjust call to GLImport.gnulib_comp to reflect
+	parameter changes.
+
 2024-03-08  Collin Funk  
 
 	gnulib-tool.py: Follow gnulib-tool changes, part 49.
diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO
index 7031462593..eedb916ca9 100644
--- a/gnulib-tool.py.TODO
+++ b/gnulib-tool.py.TODO
@@ -344,26 +344,6 @@ Date:   Wed Dec 15 19:18:31 2021 +0100
 
 
 
-commit dc08febea1fc0a8c902dfa89d0abc2952873529b
-Author: Bruno Haible 
-Date:   Mon Dec 13 03:03:13 2021 +0100
-
-gnulib-tool: Fix mistake in last commit.
-
-commit 4e7b4cc6fb3e3b659c98baf6db26d8a06099fbee
-Author: Bruno Haible 
-Date:   Mon Dec 13 02:43:21 2021 +0100
-
-gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests.
-
-* gnulib-tool (func_import): Synthesize an AC_CONFIG_LIBOBJ_DIR
-invocation.
-* m4/non-recursive-gnulib-prefix-hack.m4
-(gl_NON_RECURSIVE_GNULIB_PREFIX_HACK): Don't invoke
-AC_CONFIG_LIBOBJ_DIR.
-
-
-
 commit 4b071c115309079528db7b60e8d2ffb22b129088
 Author: Paul Eggert 
 Date:   Mon Apr 26 23:31:29 2021 -0700
diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 24c6623293..9ba2775425 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -562,16 +562,21 @@ class GLImport(object):
 emit += 'gl_VC_FILES([%s])\n' % vc_files
 return constants.nlconvert(emit)
 
-def gnulib_comp(self, files, gentests):

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

2024-03-09 Thread Bruno Haible
Hi Collin,

> Here is a patch removing one more item from gnulib-tool.py.TODO.

Thanks! Applied.

> I saw another TODO item referencing a separate patch needed for
> test-driver distributed with a specific version of Automake.

Yes; that one will be an easy extension of what you added today.

> It seems that Python added enums after
> gnulib-tool.py was originally written [1].

Yes, Python enums did not exist at the time Dmitry was targeting
Python 2.7 / 3.0.

Bruno