From: Collin Funk Date: Wed, 20 Mar 2024 07:57:50 +0000 (-0700) Subject: gnulib-tool.py: Don't print empty Automake snippets. X-Git-Tag: v1.0~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28ce6d000e379a5cf8caeeba1aa50c3df1890ec6;p=thirdparty%2Fgnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 5a48bd1474..fc095fd92c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-03-20 Collin Funk + + 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 gnulib-tool.py: Follow gnulib-tool changes, part 68. diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 6b61111374..8c2e3b5540 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -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)