bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python './gnulib-tool --create-testdir --dir F' should quickly warn


From: Bruno Haible
Subject: Re: Python './gnulib-tool --create-testdir --dir F' should quickly warn if F exists
Date: Tue, 14 May 2024 11:24:15 +0200

Collin Funk wrote:
> I've applied the attached patch. 
> ...
>   $ gnulib-tool --create-testdir --dir foo -h stdbit 
>   not overwriting destination directory: foo
>   /home/collin/.local/src/gnulib/gnulib-tool.py: *** Stop.

Thanks!

But the first line of this diagnostic looks strange, without an
indication where it comes from. Recall our conventions:
  - For an error during option handling, prepend the absolute program name.
  - For an error due to the contents of some files, prepend the base name
    of the program.

I'm adding the patch below that changes the diagnostic

  $ ./gnulib-tool --create-testdir --dir foo stdbit
  not overwriting destination directory: foo
  /GNULIB/gnulib-git/gnulib-tool.py: *** Stop.

to

  $ ./gnulib-tool --create-testdir --dir foo stdbit
  /GNULIB/gnulib-git/gnulib-tool.py: *** not overwriting destination directory: 
foo
  /GNULIB/gnulib-git/gnulib-tool.py: *** Stop.

> Likewise for --create-megatestdir.

Good.

> I can do the same in gnulib-tool.sh
> if you would like since it should be pretty easy there too.

This is not needed. The Python implementation is already the default.
We haven't heard from anyone who needs to run the shell implementation.
You can do more useful things within your available time.


2024-05-14  Bruno Haible  <bruno@clisp.org>

        gnulib-tool.py: Fix formatting of error message in last commit.
        * pygnulib/main.py (main_with_exception_handling): Use the usual
        formatting of error messages.

diff --git a/pygnulib/main.py b/pygnulib/main.py
index aeb78ad2c7..dc0b2f4366 100644
--- a/pygnulib/main.py
+++ b/pygnulib/main.py
@@ -1439,7 +1439,7 @@ def main_with_exception_handling() -> None:
                             'supported if the definition of AUTOMAKE_OPTIONS 
in '
                             'Makefile.am contains \'subdir-objects\'.')
             elif errno == 22:
-                message = 'not overwriting destination directory: %s' % errinfo
+                message += 'not overwriting destination directory: %s' % 
errinfo
             message += '\n%s: *** Stop.\n' % APP['name']
             sys.stderr.write(message)
             sys.exit(1)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]