This patch just fixes two simple newline differences in test
directories.

$ diff -u ./test-create-megatestdir-2.result/fopen-gnu/configure.ac 
tmp364942-result/fopen-gnu/configure.ac
--- ./test-create-megatestdir-2.result/fopen-gnu/configure.ac   2024-03-22 
11:23:00.239344218 -0700
+++ tmp364942-result/fopen-gnu/configure.ac     2024-03-22 12:01:08.187972684 
-0700
@@ -23,7 +23,6 @@
 gl_PROG_AR_RANLIB
 
 AM_PROG_CC_C_O
-
 gl_FP_IEEE
 AC_SYS_LARGEFILE
 gl_ANYTHREADLIB_EARLY

$ diff -u ./test-create-megatestdir-2.result/configure.ac 
tmp413846-result/configure.ac
--- ./test-create-megatestdir-2.result/configure.ac     2024-03-22 
11:23:00.237344215 -0700
+++ tmp413846-result/configure.ac       2024-03-22 12:07:07.816856295 -0700
@@ -1,5 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 AC_INIT([dummy], [0])
+
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE

Also, something that may be worth keeping in mind as we try to match
the output of gnulib-tool.py and gnulib-tool.sh, I find it easier to
follow this:

    emit += 'AM_PROG_CC_C_O\n'
    emit += '\n'

rather than this:

    emit += 'AM_PROG_CC_C_O\n\n'

Since it more closely resembles the 'echo' invocations. Nothing worth
losing sleep over, but worth keeping in mind.

Collin
From 10552567f36ffd5fb8e27de785b39bf00c051d39 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Fri, 22 Mar 2024 12:19:28 -0700
Subject: [PATCH] gnulib-tool.py: Fix empty newline output in test directories.

* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Match newlines printed by gnulib-tool.sh.
---
 ChangeLog             | 6 ++++++
 pygnulib/GLTestDir.py | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 38633a82e9..183a1e1996 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-03-22  Collin Funk  <collin.fu...@gmail.com>
+
+	gnulib-tool.py: Fix empty newline output in test directories.
+	* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
+	Match newlines printed by gnulib-tool.sh.
+
 2024-03-22  Collin Funk  <collin.fu...@gmail.com>
 
 	gnulib-tool.py: Fix unconditional Automake snippets for non-tests.
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index ea16d808a3..6f6a75931a 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -580,6 +580,7 @@ class GLTestDir(object):
         emit += self.emitter.preEarlyMacros(False, '', modules)
         if any_uses_subdirs:
             emit += 'AM_PROG_CC_C_O\n'
+            emit += '\n'
         snippets = list()
         for module in final_modules:
             if single_configure:
@@ -1018,7 +1019,7 @@ class GLMegaTestDir(object):
 
         emit = '# Process this file with autoconf '
         emit += 'to produce a configure script.\n'
-        emit += 'AC_INIT([dummy], [0])\n\n'
+        emit += 'AC_INIT([dummy], [0])\n'
         if auxdir != '.':
             emit += 'AC_CONFIG_AUX_DIR([%s])\n' % auxdir
         emit += 'AM_INIT_AUTOMAKE\n\n'
-- 
2.44.0

Reply via email to