>From 0b8158dc67dfd23d00cbe67218ef78a0e889df86 Mon Sep 17 00:00:00 2001 Message-Id:
From: Stefano Lattarini Date: Sat, 25 Feb 2012 14:38:22 +0100 Subject: [PATCH] docs: improve "make distcheck" documentation * doc/automake.texi (The dist Hook): Explicitly document the fact that the dist-hook should account for the case where the source tree is read-only, mostly for the benefit of distcheck. Since we are at it, do some minor unrelated rewordings, and remove obsolescent advice. Motivated by the discussion on automake bug#10878. * tests/disthook-perms.test: Renamed ... * tests/disthook.test: ... to this, and extended. * tests/list-of-tests.mk: Adjust. --- doc/automake.texi | 28 +++++++++----- tests/{disthook-perms.test => disthook.test} | 50 ++++++++++++++++++------- tests/list-of-tests.mk | 2 +- 3 files changed, 55 insertions(+), 25 deletions(-) rename tests/{disthook-perms.test => disthook.test} (55%) diff --git a/doc/automake.texi b/doc/automake.texi index c2c2a21..36e9882 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -8420,24 +8420,32 @@ nodist_foo_SOURCES = do-not-distribute.c Occasionally it is useful to be able to change the distribution before it is packaged up. If the @code{dist-hook} rule exists, it is run -after the distribution directory is filled, but before the actual tar -(or shar) file is created. One way to use this is for distributing -files in subdirectories for which a new @file{Makefile.am} is overkill: +after the distribution directory is filled, but before the actual +distribution archives are created. One way to use this is for +removing unnecessary files that get recursively included by specifying +a directory in @code{EXTRA_DIST}: @example +EXTRA_DIST = doc dist-hook: - mkdir $(distdir)/random - cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random + rm -rf `find $(distdir)/doc -type d -name .svn` @end example -Another way to use this is for removing unnecessary files that get -recursively included by specifying a directory in EXTRA_DIST: address@hidden +Note that the @code{dist-hook} recipe shouldn't assume that the +regular files in the distribution directory are writable; this +might not be the case if one is packaging from a read-only source +tree, or when a @code{make distcheck} is being done. So, if the address@hidden wants to modify the content of an existing file +in the distribution directory, it should explicitly ensure to make +it readable first: @example -EXTRA_DIST = doc - +EXTRA_DIST = README dist-hook: - rm -rf `find $(distdir)/doc -type d -name .svn` + chmod u+w $(distdir)/README + echo >> README + echo "Distribution date: `date`" >> README @end example @vindex distdir diff --git a/tests/disthook-perms.test b/tests/disthook.test similarity index 55% rename from tests/disthook-perms.test rename to tests/disthook.test index a5f0acb..d5afe83 100755 --- a/tests/disthook-perms.test +++ b/tests/disthook.test @@ -14,19 +14,32 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see