From e25bb2729fb25294c82cf989628538ca763782ac Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Fri, 12 Apr 2024 18:34:49 -0700 Subject: [PATCH] gnulib-tool.py: Fix --copy-file directory creation. Reported by Bruno Haible in * pygnulib/main.py (main): Make sure that destdir is set in the GLConfig object before copying files. --- ChangeLog | 8 ++++++++ gnulib-tool.py.TODO | 2 -- pygnulib/main.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f5904281c..80679d0743 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-04-12 Collin Funk + + gnulib-tool.py: Fix --copy-file directory creation. + Reported by Bruno Haible in + + * pygnulib/main.py (main): Make sure that destdir is set in the GLConfig + object before copying files. + 2024-04-12 Bruno Haible gnulib-tool.py: Implement --add-import --with-*-tests correctly. diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO index 88e92150f4..2db551d4e0 100644 --- a/gnulib-tool.py.TODO +++ b/gnulib-tool.py.TODO @@ -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 diff --git a/pygnulib/main.py b/pygnulib/main.py index f654d5b109..4b64305049 100644 --- a/pygnulib/main.py +++ b/pygnulib/main.py @@ -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. -- 2.39.5