From: Collin Funk Date: Sat, 24 Feb 2024 04:52:15 +0000 (-0800) Subject: gnulib-tool.py: Follow gnulib-tool changes, part 28. X-Git-Tag: v1.0~377 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4bbad421722949370faeb3733f247e21b110469;p=thirdparty%2Fgnulib.git gnulib-tool.py: Follow gnulib-tool changes, part 28. Follow gnulib-tool change 2018-07-17 Paul Eggert gnulib-tool: limit line length for git send-email * pygnulib/GLImport.py (GLImport.actioncmd): Break actioncmd into multiple lines. Reorder emitting of arguments to match gnulib-tool. Emit "--witness-c-macro" instead of "--witness_c_macro". Emit "--po-domain" instead of "--podomain". Document ordering of unimplemented options. Add updated comments documenting line length limitations of git send-email and some implementations of AWK. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Remove comment which was moved to pygnulib/GLImport.py. Remove length limitation on actioncmd since it now spans multiple lines. --- diff --git a/ChangeLog b/ChangeLog index cd832bc554..1910933eb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2024-02-24 Collin Funk + + gnulib-tool.py: Follow gnulib-tool changes, part 28. + Follow gnulib-tool change + 2018-07-17 Paul Eggert + gnulib-tool: limit line length for git send-email + * pygnulib/GLImport.py (GLImport.actioncmd): Break actioncmd into + multiple lines. Reorder emitting of arguments to match gnulib-tool. Emit + "--witness-c-macro" instead of "--witness_c_macro". Emit "--po-domain" + instead of "--podomain". Document ordering of unimplemented options. Add + updated comments documenting line length limitations of git send-email + and some implementations of AWK. + * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Remove comment which + was moved to pygnulib/GLImport.py. Remove length limitation on actioncmd + since it now spans multiple lines. + 2024-02-24 Bruno Haible gnulib-tool.py: Further fix last commit. diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO index 3313839a32..c72746941e 100644 --- a/gnulib-tool.py.TODO +++ b/gnulib-tool.py.TODO @@ -779,17 +779,6 @@ Date: Mon Sep 3 21:19:16 2018 +0200 -------------------------------------------------------------------------------- -commit a1276e5bf2286afec7b0445040be05cad858cdd1 -Author: Paul Eggert -Date: Tue Jul 17 15:20:39 2018 -0700 - - gnulib-tool: limit line length for git send-email - - * gnulib-tool (func_import): Break actioncmd log line - into multiple lines. - --------------------------------------------------------------------------------- - commit 589e96475f8f2d21a83405ab0672ce95091b80e5 Author: Bruno Haible Date: Fri Dec 29 00:29:23 2017 +0100 diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 6de9aba68a..56e8156761 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -668,13 +668,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [ emit += "## Process this file with automake to produce Makefile.in.\n" emit += self.copyright_notice() if actioncmd: - # The maximum line length (excluding the terminating newline) of - # any file that is to be preprocessed by config.status is 3070. - # config.status uses awk, and the HP-UX 11.00 awk fails if a line - # has length >= 3071; similarly, the IRIX 6.5 awk fails if a line - # has length >= 3072. - if len(actioncmd) <= 3000: - emit += "# Reproduce by: %s\n" % actioncmd + emit += "# Reproduce by:\n%s\n" % actioncmd emit += '\n' uses_subdirs = False diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index e01cb9f63e..c69a33deb7 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -374,63 +374,73 @@ class GLImport(object): vc_files = self.config.checkVCFiles() verbose = self.config.getVerbosity() - # Create command-line invocation comment. - actioncmd = 'gnulib-tool --import' - actioncmd += ' --dir=%s' % destdir - for localdir in localpath: - actioncmd += ' --local-dir=%s' % localdir - actioncmd += ' --lib=%s' % libname - actioncmd += ' --source-base=%s' % sourcebase - actioncmd += ' --m4-base=%s' % m4base + # Command-line invocation printed in a comment in generated gnulib-cache.m4. + actioncmd = '# gnulib-tool --import' + + # Break the action command log into multiple lines. + # Emacs puts some gnulib-tool log lines in its source repository, and + # git send-email rejects patch lines longer than 998 characters. + # Also, config.status uses awk, and the HP-UX 11.00 awk fails if a + # line has length >= 3071; similarly, the IRIX 6.5 awk fails if a + # line has length >= 3072. + if len(localpath) > 0: + actioncmd += ''.join([f" \\\n# --local-dir={x}" for x in localpath]) + actioncmd += ' \\\n# --lib=%s' % libname + actioncmd += ' \\\n# --source-base=%s' % sourcebase + actioncmd += ' \\\n# --m4-base=%s' % m4base if pobase: - actioncmd += ' --po-base=%s' % pobase - actioncmd += ' --doc-base=%s' % docbase - actioncmd += ' --tests-base=%s' % testsbase - actioncmd += ' --aux-dir=%s' % auxdir + actioncmd += ' \\\n# --po-base=%s' % pobase + actioncmd += ' \\\n# --doc-base=%s' % docbase + actioncmd += ' \\\n# --tests-base=%s' % testsbase + actioncmd += ' \\\n# --aux-dir=%s' % auxdir if self.config.checkInclTestCategory(TESTS['tests']): - actioncmd += ' --with-tests' + actioncmd += ' \\\n# --with-tests' if self.config.checkInclTestCategory(TESTS['obsolete']): - actioncmd += ' --with-obsolete' + actioncmd += ' \\\n# --with-obsolete' if self.config.checkInclTestCategory(TESTS['c++-test']): - actioncmd += ' --with-c++-tests' + actioncmd += ' \\\n# --with-c++-tests' if self.config.checkInclTestCategory(TESTS['longrunning-test']): - actioncmd += ' --with-longrunning-tests' + actioncmd += ' \\\n# --with-longrunning-tests' if self.config.checkInclTestCategory(TESTS['privileged-test']): - actioncmd += ' --with-privileged-test' + actioncmd += ' \\\n# --with-privileged-test' if self.config.checkInclTestCategory(TESTS['unportable-test']): - actioncmd += ' --with-unportable-tests' + actioncmd += ' \\\n# --with-unportable-tests' if self.config.checkInclTestCategory(TESTS['all-test']): - actioncmd += ' --with-all-tests' - for module in avoids: - actioncmd += ' --avoid=%s' % module + actioncmd += ' \\\n# --with-all-tests' if lgpl: if lgpl == True: - actioncmd += ' --lgpl' + actioncmd += ' \\\n# --lgpl' else: # if lgpl != True - actioncmd += ' --lgpl=%s' % lgpl + actioncmd += ' \\\n# --lgpl=%s' % lgpl if gnu_make: - actioncmd += ' --gnu-make' + actioncmd += ' \\\n# --gnu-make' if makefile_name: - actioncmd += ' --makefile-name=%s' % makefile_name + actioncmd += ' \\\n# --makefile-name=%s' % makefile_name + # FIXME: Add the following options in this order when implemented. + # --tests-makefile-name + # --automake-subdir + # --automake-subdir-tests if conddeps: - actioncmd += ' --conditional-dependencies' + actioncmd += ' \\\n# --conditional-dependencies' else: # if not conddeps - actioncmd += ' --no-conditional-dependencies' + actioncmd += ' \\\n# --no-conditional-dependencies' if libtool: - actioncmd += ' --libtool' + actioncmd += ' \\\n# --libtool' else: # if not libtool - actioncmd += ' --no-libtool' - actioncmd += ' --macro-prefix=%s' % macro_prefix + actioncmd += ' \\\n# --no-libtool' + actioncmd += ' \\\n# --macro-prefix=%s' % macro_prefix if podomain: - actioncmd = ' --podomain=%s' % podomain + actioncmd = ' \\\n# --po-domain=%s' % podomain if witness_c_macro: - actioncmd += ' --witness_c_macro=%s' % witness_c_macro + actioncmd += ' \\\n# --witness-c-macro=%s' % witness_c_macro if vc_files == True: - actioncmd += ' --vc-files' + actioncmd += ' \\\n# --vc-files' elif vc_files == False: - actioncmd += ' --no-vc-files' - actioncmd += ' ' # Add a space - actioncmd += ' '.join(modules) + actioncmd += ' \\\n# --no-vc-files' + if len(avoids) > 0: + actioncmd += ''.join([f" \\\n# --avoid={x}" for x in sorted(avoids)]) + if len(modules) > 0: + actioncmd += ''.join([f" \\\n# {x}" for x in sorted(modules)]) return actioncmd def relative_to_destdir(self, dir):