From: Collin Funk <collin.funk1@gmail.com>
Date: Sat, 9 Mar 2024 06:30:03 +0000 (-0800)
Subject: gnulib-tool.py: Follow gnulib-tool changes, part 49.
X-Git-Tag: v1.0~308
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=45479be70defd4133ea11e2b8c14fe77dad7e405;p=gnulib.git

gnulib-tool.py: Follow gnulib-tool changes, part 49.

Follow gnulib-tool change
2021-08-07  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Add support for Automake 1.16.4.

* pygnulib/GLTestDir.py (_patch_test_driver): If patching
build-aux/test-driver fails with build-aux/test-driver.diff try again
with build-aux/test-driver-1.16.3.diff.
---

diff --git a/ChangeLog b/ChangeLog
index cc1f322a17..3295f44c10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-03-09  Collin Funk  <collin.funk1@gmail.com>
+
+	gnulib-tool.py: Follow gnulib-tool changes, part 49.
+	Follow gnulib-tool change
+	2021-08-07  Bruno Haible  <bruno@clisp.org>
+	gnulib-tool: Add support for Automake 1.16.4.
+	* pygnulib/GLTestDir.py (_patch_test_driver): If patching
+	build-aux/test-driver fails with build-aux/test-driver.diff try again
+	with build-aux/test-driver-1.16.3.diff.
+
 2024-03-09  Bruno Haible  <bruno@clisp.org>
 
 	unistr/u16-to-u32: Relicense under LGPLv2+.
diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO
index 7632991780..7031462593 100644
--- a/gnulib-tool.py.TODO
+++ b/gnulib-tool.py.TODO
@@ -364,22 +364,6 @@ Date:   Mon Dec 13 02:43:21 2021 +0100
 
 --------------------------------------------------------------------------------
 
-commit 6ccfbd6495f2849b1aeea84f73327f6ced0080a7
-Author: Bruno Haible <bruno@clisp.org>
-Date:   Sun Aug 8 03:52:01 2021 +0200
-
-    gnulib-tool: Add support for Automake 1.16.4.
-
-    Reported by <shoober420@gmail.com> in
-    <https://lists.gnu.org/archive/html/bug-libunistring/2021-08/msg00000.html>.
-
-    * build-aux/test-driver-1.16.3.diff: Renamed from build-aux/test-driver.diff.
-    * build-aux/test-driver.diff: Update to match Automake 1.16.4.
-    * gnulib-tool (func_create_testdir, func_create_megatestdir): Try both
-    .diff files.
-
---------------------------------------------------------------------------------
-
 commit 4b071c115309079528db7b60e8d2ffb22b129088
 Author: Paul Eggert <eggert@cs.ucla.edu>
 Date:   Mon Apr 26 23:31:29 2021 -0700
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 5a4c38f049..b294dbd58b 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -60,13 +60,20 @@ normpath = os.path.normpath
 def _patch_test_driver() -> None:
     '''Patch the test-driver script in testdirs.'''
     test_driver = joinpath('build-aux', 'test-driver')
-    diff = joinpath(DIRS['root'], joinpath('build-aux', 'test-driver.diff'))
-    command = f'patch {test_driver} < {diff}'
-    try:
-        result = sp.call(command, shell=True)
-        if result != 0:
+    diffs = [ joinpath(DIRS['root'], name)
+              for name in [joinpath('build-aux', 'test-driver.diff'),
+                           joinpath('build-aux', 'test-driver-1.16.3.diff')]]
+    patched = False
+    for diff in diffs:
+        command = f'patch {test_driver} < {diff}'
+        try:
+            result = sp.call(command, shell=True)
+        except OSError:
             raise GLError(20, None)
-    except OSError:
+        if result == 0:
+            patched = True
+            break
+    if not patched:
         raise GLError(20, None)