]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Locate configure.ac correctly when --dir is given.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 6 Apr 2024 11:41:03 +0000 (04:41 -0700)
committerBruno Haible <bruno@clisp.org>
Sun, 7 Apr 2024 11:07:18 +0000 (13:07 +0200)
* pygnulib/GLConfig.py (GLConfig.setAutoconfFile): Don't combine the
given file name argument with destdir.
* pygnulib/main.py (main): Use os.path.join() instead of joinpath() when
constructing the path to the configure.ac file. The latter normalizes
paths which causes the test suite to fail when printed in files.

ChangeLog
pygnulib/GLConfig.py
pygnulib/main.py

index 9d069b83e226cc8580a67f69f89682c6f9be413d..7e90c5bad1fae44c89be80f0e736781118d7fc72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-04-07  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Locate configure.ac correctly when --dir is given.
+       * pygnulib/GLConfig.py (GLConfig.setAutoconfFile): Don't combine the
+       given file name argument with destdir.
+       * pygnulib/main.py (main): Use os.path.join() instead of joinpath() when
+       constructing the path to the configure.ac file. The latter normalizes
+       paths which causes the test suite to fail when printed in files.
+
 2024-04-06  Bruno Haible  <bruno@clisp.org>
 
        expm1l: Work around a NetBSD 10.0/i386 bug.
index 1c9caa218bcb5526b93aebcd3d5b67a33f0179d6..f5282dbf53edd16e299aefec385ff56d510abd91 100644 (file)
@@ -1025,8 +1025,7 @@ class GLConfig:
         '''Specify path of autoconf file relative to destdir.'''
         if type(configure_ac) is str:
             if configure_ac:
-                self.table['configure_ac'] = \
-                    os.path.join(self.table['destdir'], configure_ac)
+                self.table['configure_ac'] = configure_ac
         else:  # if type of configure_ac is not str
             raise TypeError('configure_ac must be a string, not %s'
                             % type(configure_ac).__name__)
index 4bf4da42799325b1031b4622d1aefc0063831502..a67252f7f6060fc73784b7562472b3ae29366645 100644 (file)
@@ -910,12 +910,14 @@ def main() -> None:
         config.setDestDir(destdir)
 
         # Prefer configure.ac but also look for configure.in.
-        if isfile(joinpath(destdir, 'configure.ac')):
-            configure_ac = joinpath(destdir, 'configure.ac')
-        elif isfile(joinpath(destdir, 'configure.in')):
-            configure_ac = joinpath(destdir, 'configure.in')
+        # NOTE: Use os.path.join so the leading './' is not removed. This
+        # is to make the gnulib-tool test suite happy.
+        if isfile(os.path.join(destdir, 'configure.ac')):
+            configure_ac = os.path.join(destdir, 'configure.ac')
+        elif isfile(os.path.join(destdir, 'configure.in')):
+            configure_ac = os.path.join(destdir, 'configure.in')
         else:
-            raise GLError(3, joinpath(destdir, 'configure.ac'))
+            raise GLError(3, os.path.join(destdir, 'configure.ac'))
 
         # Save the Autoconf file path for the rest of the import.
         config.setAutoconfFile(configure_ac)