gnulib-tool.py: Don't print empty Automake snippets.
authorCollin Funk <collin.funk1@gmail.com>
Wed, 20 Mar 2024 07:57:50 +0000 (00:57 -0700)
committerBruno Haible <bruno@clisp.org>
Wed, 20 Mar 2024 10:03:53 +0000 (11:03 +0100)
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am)
(GLEmiter.tests_Makefile_am): Handle empty strings when checking if the
snippet should be printed.

ChangeLog
pygnulib/GLEmiter.py

index 5a48bd1474c1d314077714da17a32d2cea1028f4..fc095fd92c0cf3a1b3eea374b74f63be7691b03c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-03-20  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Don't print empty Automake snippets.
+       * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am)
+       (GLEmiter.tests_Makefile_am): Handle empty strings when checking if the
+       snippet should be printed.
+
 2024-03-19  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Follow gnulib-tool changes, part 68.
index 6b6111137458f076beaae3c8cc338fbac892ffd0..8c2e3b554018401cc9443af1b6ad10bd784958a0 100644 (file)
@@ -846,7 +846,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 amsnippet2 = amsnippet2.replace('$(GNULIB_',
                                                 '$(' + module_indicator_prefix + '_GNULIB_')
                 # Skip the contents if it's entirely empty.
-                if not (amsnippet1 + amsnippet2).isspace():
+                if (amsnippet1 + amsnippet2).strip() != '':
                     allsnippets += '## begin gnulib module %s\n' % str(module)
                     if gnu_make:
                         allsnippets += 'ifeq (,$(OMIT_GNULIB_MODULE_%s))\n' % str(module)
@@ -1160,7 +1160,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [
                 amsnippet2 = amsnippet2.replace('$(GNULIB_',
                                                 '$(' + module_indicator_prefix + '_GNULIB_')
                 # Skip the contents if it's entirely empty.
-                if not (amsnippet1 + amsnippet2).isspace():
+                if (amsnippet1 + amsnippet2).strip() != '':
                     snippet = '## begin gnulib module %s\n' % str(module)
                     if gnu_make:
                         snippet += 'ifeq (,$(OMIT_GNULIB_MODULE_%s))\n' % str(module)