Hi Collin,

> > Should
> > the sed invocations [1] be changed to only replace lines if they start
> > with @NMD@ instead of all lines that contain @NMD@?

Let's see where this occurs:

$ grep -r NMD@ modules | grep -v :@
modules/posix-shell:#@NMD@      $(AM_V_GEN)$(MKDIR_P) '%reldir%'
modules/gen-header:# is its recipe's first line if and only if @NMD@ lines are 
absent.

You're right: Since the line gets deleted in one case or the other, it makes
sense only if the @NMD@ or @!NMD@ marker occurs at the beginning of the line.

> 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

This looks good. Please include this change among your patches. Thanks!

Bruno




Reply via email to