This patch just modifies the timestamp of 'config.h.in' after
executing 'autoheader'.

I've used the Pathlib touch function which I will admit looks a bit
strange [1]. I've tested it and it should update the timestamps
properly though.

My reasoning for this is that the 'constants.execute' command used
above it is a bit strange. I rather not add more opportunities for it
to break. When --verbose is used sp.call() uses shell=False. When it
is not, shell=True is used. Therefore I don't think we can use it to
call 'autoheader && touch config.h.in'.

I've left that function as-is for now, but I will probably get around
to cleaning it & it's callers eventually.

[1] https://docs.python.org/3/library/pathlib.html#pathlib.Path.touch

Collin
From cf2c30d09f7210b1e42bbae3ae239c6e9c0c61c0 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Sat, 16 Mar 2024 14:52:21 -0700
Subject: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 59.

Follow gnulib-tool change
2017-10-29  Bruno Haible  <br...@clisp.org>
gnulib-tool: Avoid unnecessary config.h.in remaking in testdirs.

* pygnulib/GLTestDir.py (GLTestDir.execute): Touch the 'config.h.in'
file after executing 'autoheader' to update it's timestamps.
---
 ChangeLog             |  9 +++++++++
 gnulib-tool.py.TODO   | 11 -----------
 pygnulib/GLTestDir.py |  3 +++
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 44ff5a5475..b942676828 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-16  Collin Funk  <collin.fu...@gmail.com>
+
+	gnulib-tool.py: Follow gnulib-tool changes, part 59.
+	Follow gnulib-tool change
+	2017-10-29  Bruno Haible  <br...@clisp.org>
+	gnulib-tool: Avoid unnecessary config.h.in remaking in testdirs.
+	* pygnulib/GLTestDir.py (GLTestDir.execute): Touch the 'config.h.in'
+	file after executing 'autoheader' to update it's timestamps.
+
 2024-03-16  Collin Funk  <collin.fu...@gmail.com>
 
 	gnulib-tool.py: Coding style: Avoid not().
diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO
index eb315de832..8d76b38cd9 100644
--- a/gnulib-tool.py.TODO
+++ b/gnulib-tool.py.TODO
@@ -172,17 +172,6 @@ Date:   Mon Nov 18 13:32:46 2019 +0100
 
 --------------------------------------------------------------------------------
 
-commit cd58dba367a3b8ffbebb23f2099a820106197fae
-Author: Bruno Haible <br...@clisp.org>
-Date:   Sun Oct 29 16:57:32 2017 +0100
-
-    gnulib-tool: Avoid unnecessary config.h.in remaking in testdirs.
-
-    * gnulib-tool (func_create_testdir): Use workaround against 'autoheader'
-    bug reported at <https://savannah.gnu.org/support/index.php?109406>.
-
---------------------------------------------------------------------------------
-
 commit 30459fe101541698ec704acb224946d73676750e
 Author: Bruno Haible <br...@clisp.org>
 Date:   Thu Jun 8 15:09:31 2017 +0200
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 024260f655..d01893922c 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -22,6 +22,7 @@ import sys
 import codecs
 import subprocess as sp
 import shutil
+from pathlib import Path
 from . import constants
 from .GLError import GLError
 from .GLConfig import GLConfig
@@ -696,6 +697,7 @@ class GLTestDir(object):
         # autoheader
         args = [UTILS['autoheader']]
         constants.execute(args, verbose)
+        Path('config.h.in').touch()
         # automake
         args = [UTILS['automake'], '--add-missing', '--copy']
         constants.execute(args, verbose)
@@ -727,6 +729,7 @@ class GLTestDir(object):
             # autoheader
             args = [UTILS['autoheader']]
             constants.execute(args, verbose)
+            Path('config.h.in').touch()
             # automake
             args = [UTILS['automake'], '--add-missing', '--copy']
             constants.execute(args, verbose)
-- 
2.44.0

Reply via email to