On 3/7/24 6:10 PM, Collin Funk wrote:
> I have not implemented it yet in gnulib-tool.py so the snippet is just
> copy and pasted from the module. The part I wanted to ask about was
> the second line of the comment which is removed by gnulib-tool. Should
> the sed invocations [1] be changed to only replace lines if they start
> with @NMD@ instead of all lines that contain @NMD@?

As a quick test, I used a bootstrap script with these changes to build
coreutils:

diff --git a/gnulib-tool b/gnulib-tool
index 9eb8c4ab87..0cf5e54a20 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3773,9 +3773,9 @@ func_emit_lib_Makefile_am ()
   # Replace NMD, so as to remove redundant "$(MKDIR_P) '.'" invocations.
   # The logic is similar to how we define gl_source_base_prefix.
   if $automake_subdir; then
-    sed_eliminate_NMD='s/@NMD@//;/@!NMD@/d'
+    sed_eliminate_NMD='s/^@NMD@//;/^@!NMD@/d'
   else
-    sed_eliminate_NMD='/@NMD@/d;s/@!NMD@//'
+    sed_eliminate_NMD='/^@NMD@/d;s/^@!NMD@//'
   fi

Everything worked fine and the comment was preserved.

Collin

Reply via email to