]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Fix output of notices.
authorBruno Haible <bruno@clisp.org>
Sun, 24 Mar 2024 11:06:50 +0000 (12:06 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 24 Mar 2024 11:06:50 +0000 (12:06 +0100)
* pygnulib/GLTestDir.py (GLTestDir.execute): Don't print notices if the
verbosity is < -1. Strip newlines from each notice.
* pygnulib/GLImport.py (GLImport.prepare): Don't print notices if the
verbosity is < -1. Strip only newlines, not spaces.

ChangeLog
pygnulib/GLImport.py
pygnulib/GLTestDir.py

index 6f2c22b9b63d1b44456e7ac0ae321fd1226d93af..305da4bbbf2e70a6c4e7e00305c4c60acb845758 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-03-24  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool.py: Fix output of notices.
+       * pygnulib/GLTestDir.py (GLTestDir.execute): Don't print notices if the
+       verbosity is < -1. Strip newlines from each notice.
+       * pygnulib/GLImport.py (GLImport.prepare): Don't print notices if the
+       verbosity is < -1. Strip only newlines, not spaces.
+
 2024-03-23  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Fix the modules indentation in --create-testdir' output.
index 85ec0a61dbce44c1839c7f3b22ed38cb62e99a4e..d417137df641ea4a46c4d9e15ceb625deb89e11c 100644 (file)
@@ -939,14 +939,14 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
                 raise GLError(11, listing)
 
         # Print notices from modules.
-        for module in main_modules:
-            notice = module.getNotice()
-            notice = notice.strip()
-            if notice:
-                print('Notice from module %s:' % str(module))
-                pattern = re.compile('^(.*?)$', re.S | re.M)
-                notice = pattern.sub('  \\1', notice)
-                print(notice)
+        if verbose >= -1:
+            for module in main_modules:
+                notice = module.getNotice().strip('\n')
+                if notice:
+                    print('Notice from module %s:' % str(module))
+                    pattern = re.compile('^(.*?)$', re.S | re.M)
+                    notice = pattern.sub('  \\1', notice)
+                    print(notice)
 
         # Determine script to apply to imported library files.
         sed_transform_lib_file = ''
index c618241bc961361e8b6eaf41d53eff60197ddde2..d6d6a9f95412709cbe9363edadfaff0e3faebb65 100644 (file)
@@ -312,21 +312,23 @@ class GLTestDir(object):
 
         # Show banner notice of every module.
         if single_configure:
-            for module in main_modules:
-                notice = module.getNotice()
-                if notice:
-                    print('Notice from module %s:' % str(module))
-                    pattern = re.compile('^(.*)$', re.M)
-                    notice = pattern.sub('  \\1', notice)
-                    print(notice)
+            if verbose >= -1:
+                for module in main_modules:
+                    notice = module.getNotice().strip('\n')
+                    if notice:
+                        print('Notice from module %s:' % str(module))
+                        pattern = re.compile('^(.*)$', re.M)
+                        notice = pattern.sub('  \\1', notice)
+                        print(notice)
         else:  # if not single_configure
-            for module in modules:
-                notice = module.getNotice()
-                if notice:
-                    print('Notice from module %s:' % str(module))
-                    pattern = re.compile('^(.*)$', re.M)
-                    notice = pattern.sub('  \\1', notice)
-                    print(notice)
+            if verbose >= -1:
+                for module in modules:
+                    notice = module.getNotice().strip('\n')
+                    if notice:
+                        print('Notice from module %s:' % str(module))
+                        pattern = re.compile('^(.*)$', re.M)
+                        notice = pattern.sub('  \\1', notice)
+                        print(notice)
 
         # Determine final file list.
         if single_configure: