Hi,

Bruno Haible <br...@clisp.org> writes:

> Mathieu Lirzin wrote:
>> Here is the patch:
>
> Given the code from gnulib-tool that you are removing, I think:
>
>> +EXTRA_DIST += top/GNUmakefile
>
> This should read
>
>    EXTRA_DIST += $(top_srcdir)/GNUmakefile
>
>> +EXTRA_DIST += top/maint.mk
>
> This should read
>
>    EXTRA_DIST += $(top_srcdir)/maint.mk
>
> otherwise gnulib-tool's --create-testdir with the named modules will break.
>
> Can you please revisit this (i.e. test --create-testdir once without and once
> with my proposed correction)?
>
> Bruno

I didn't know how to test my patch without setting up a project
manually.  Thank you for explaining me how to do that.  I was able to
identify my mistake then.

Here is an updated patch with a rationale in the ChangeLog:

>From 7d23604cdc98cffdb1b05771863218914ee59646 Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin <m...@gnu.org>
Date: Tue, 14 Mar 2017 12:19:40 +0100
Subject: [PATCH] gnulib-tool: don't automatically distribute files from top/

* gnulib-tool (func_get_automake_snippet_unconditional): To be able to
not distribute top/README-release by default, don't distribute files
from top/ unconditionally.
* modules/gnumakefile (Makefile.am): Distribute top/GNUmakefile.
* modules/maintainer-makefile (Makefile.am): Distribute top/maint.mk.
---
 ChangeLog                   | 9 +++++++++
 gnulib-tool                 | 7 -------
 modules/gnumakefile         | 1 +
 modules/maintainer-makefile | 3 +++
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 09aec7b50..0bde222d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-03-14  Mathieu Lirzin  <m...@gnu.org>
+
+	gnulib-tool: don't automatically distribute files from top/
+	* gnulib-tool (func_get_automake_snippet_unconditional): To be able to
+	not distribute top/README-release by default, don't distribute files
+	from top/ unconditionally.
+	* modules/gnumakefile (Makefile.am): Distribute top/GNUmakefile.
+	* modules/maintainer-makefile (Makefile.am): Distribute top/maint.mk.
+
 2017-03-14  Paul Eggert  <egg...@cs.ucla.edu>
 
 	snippets: work around GNU Make 3.82 VPATH
diff --git a/gnulib-tool b/gnulib-tool
index 3ff40b879..3e282c8df 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -2461,13 +2461,6 @@ func_get_automake_snippet_unconditional ()
         echo "EXTRA_DIST += "`echo "$buildaux_files" | sed -e "$sed_prepend_auxdir"`
         echo
       fi
-      # Synthesize an EXTRA_DIST augmentation also for the files from top/.
-      func_filter_filelist top_files "$nl" "$all_files" 'top/' '' 'top/' ''
-      if test -n "$top_files"; then
-        sed_prepend_topdir='s,^,$(top_srcdir)/,'
-        echo "EXTRA_DIST += "`echo "$top_files" | sed -e "$sed_prepend_topdir"`
-        echo
-      fi
       ;;
   esac
 }
diff --git a/modules/gnumakefile b/modules/gnumakefile
index f917e36fc..644f1e8c2 100644
--- a/modules/gnumakefile
+++ b/modules/gnumakefile
@@ -19,6 +19,7 @@ m4_if(m4_version_compare([2.61a.100],
         [GNUmakefile=$GNUmakefile])])
 
 Makefile.am:
+EXTRA_DIST += $(top_srcdir)/GNUmakefile
 distclean-local: clean-GNUmakefile
 clean-GNUmakefile:
 	test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
diff --git a/modules/maintainer-makefile b/modules/maintainer-makefile
index 0045c5986..39b51583c 100644
--- a/modules/maintainer-makefile
+++ b/modules/maintainer-makefile
@@ -15,6 +15,9 @@ AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
   [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
 AC_REQUIRE([AC_PROG_SED])
 
+Makefile.am:
+EXTRA_DIST += $(top_srcdir)/maint.mk
+
 License:
 GPLed build tool
 
-- 
2.11.0

Thanks for the review (to both of you).

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

Reply via email to