bug-gnulib
[Top][All Lists]
Advanced

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

gnulib-tool.py: Fix output of notices


From: Bruno Haible
Subject: gnulib-tool.py: Fix output of notices
Date: Sun, 24 Mar 2024 12:08:32 +0100

Running test-create-testdir-4.sh, I get these output differences:

--- test-create-testdir-4.out   2024-03-19 17:48:35.022049580 +0100
+++ tmp2316177-out      2024-03-24 02:43:45.085991474 +0100
@@ -3166,97 +3166,177 @@
     yn-tests
 Notice from module atexit:
   This module is obsolete.
+  
+  
 Notice from module crypto/gc-pbkdf2-sha1:
   This module is deprecated. Use the module 'gc-pbkdf2' instead.
+  
+  
 Notice from module ctime:
...

This patch fixes it.


diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 85ec0a61db..d417137df6 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -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 = ''
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index c618241bc9..d6d6a9f954 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -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:






reply via email to

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