]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix --copy-file directory creation.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 13 Apr 2024 01:34:49 +0000 (18:34 -0700)
committerBruno Haible <bruno@clisp.org>
Sat, 13 Apr 2024 01:43:52 +0000 (03:43 +0200)
Reported by Bruno Haible in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00140.html>

* pygnulib/main.py (main): Make sure that destdir is set in the GLConfig
object before copying files.

ChangeLog
gnulib-tool.py.TODO
pygnulib/main.py

index 8f5904281c49419e8f8d8dd3e703b148e0c6cb0d..80679d0743697de2c15f4c03e970b2b3f74aa0b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-04-12  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Fix --copy-file directory creation.
+       Reported by Bruno Haible in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00140.html>
+       * pygnulib/main.py (main): Make sure that destdir is set in the GLConfig
+       object before copying files.
+
 2024-04-12  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Implement --add-import --with-*-tests correctly.
index 88e92150f4ff31c6e9a84c2e15f76c38347761ee..2db551d4e058d55bf230d5c4bba5d610b87b7d6d 100644 (file)
@@ -3,8 +3,6 @@
 
 Bugs:
   - test-cache-2-*.sh test suite failures
-  - --copy-file creates wrong directory
-    https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00140.html
   - error message missing when gl_DOC_BASE missing
     https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00160.html
 
index f654d5b109c942da9aad94bf6f4e2e8dbcead389..4b643050497e899e6d006b697746c535219ceca0 100644 (file)
@@ -1339,12 +1339,12 @@ def main() -> None:
                 except FileExistsError:
                     pass
         # Copy the file.
+        config.setDestDir(destdir)
         assistant = GLFileAssistant(config)
         tmpfile = assistant.tmpfilename(destpath)
         copyfile(lookedup, tmpfile)
         ensure_writable(tmpfile)
         assistant.setOriginal(srcpath)
-        assistant.config.setDestDir(destdir)
         assistant.setRewritten(destpath)
         if isfile(joinpath(destdir, destpath)):
             # The file already exists.