diff options
author | Alexandre Duret-Lutz <adl@gnu.org> | 2002-09-25 13:25:55 +0000 |
---|---|---|
committer | Alexandre Duret-Lutz <adl@gnu.org> | 2002-09-25 13:25:55 +0000 |
commit | f0111d7e7df2a4e74b7363144c0b5f275316d0ba (patch) | |
tree | 27b570e2b3ce26b386df5c97d25794ea80a6d420 | |
parent | b125b7ad12c2ad554e30d53fe712dfe60889b16f (diff) | |
download | automake-f0111d7e7df2a4e74b7363144c0b5f275316d0ba.tar.gz |
* NEWS: Mention distuninstallcheck.
* automake.texi (Dist): Document new macro and target.
* lib/am/distdir.am (distuninstallcheck_listfiles): New macro.
(distuninstallcheck): New target.
(distcheck): Use distuninstallcheck.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | automake.texi | 22 | ||||
-rw-r--r-- | lib/am/distdir.am | 40 | ||||
-rw-r--r-- | stamp-vti | 2 | ||||
-rw-r--r-- | version.texi | 2 |
6 files changed, 62 insertions, 15 deletions
@@ -1,3 +1,11 @@ +2002-09-25 Tom Tromey <tromey@redhat.com> + + * NEWS: Mention distuninstallcheck. + * automake.texi (Dist): Document new macro and target. + * lib/am/distdir.am (distuninstallcheck_listfiles): New macro. + (distuninstallcheck): New target. + (distcheck): Use distuninstallcheck. + 2002-09-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * tests/specflags7.test (true_CFLAGS, false_CFLAGS, false.c): Use @@ -29,6 +29,9 @@ New in 1.6f: * Add support for extending aclocal's default macro search path using a `dirlist' file within the aclocal directory. * automake --output-dir is deprecated. +* The part of the distcheck target that checks whether uninstall actually + removes all installed files has been moved in a separate target, + distuninstallcheck, so it can be overridden easily. * Many bug fixes. New in 1.6: diff --git a/automake.texi b/automake.texi index 909252999..1ddff23f7 100644 --- a/automake.texi +++ b/automake.texi @@ -4175,6 +4175,8 @@ dist-hook: @cindex make distcheck @cindex make distcleancheck @vindex distcleancheck_listfiles +@cindex make distuninstallcheck +@vindex distuninstallcheck_listfiles Automake also generates a @code{distcheck} target which can be of help to ensure that a given distribution will actually work. @@ -4235,6 +4237,26 @@ build the package. (Think about the user missing the tool required to build the file; or if the required tool is built by your package, consider the cross-compilation case where it can't be run.) +@code{distcheck} also checks that the @code{uninstall} target works +properly, both for ordinary and @samp{DESTDIR} builds. It does this +by invoking @code{make uninstall}, and then it checks the install tree +to see if any files are left over. This check will make sure that you +correctly coded your @code{uninstall}-related targets. + +By default, the checking is done by the @code{distuninstallcheck} target, +and the list of files in the install tree is generated by +@code{$(distuninstallcheck_listfiles}) (this is a variable whose value is +a shell command to run that prints the list of files to stdout). + +Either of these can be overridden to modify the behavior of +@code{distcheck}. For instance, to disable this check completely, you +would write: + +@example +distuninstallcheck: + @@: +@end example + @section The types of distributions @trindex dist-gzip diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 7ee940eec..946a96d15 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -303,6 +303,9 @@ distcheck: dist ## create this directory under $dc_install_base, because it would ## create very long directory names. && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ +## Build the directory, so we can cd into it even if `make install' +## didn't create it. + && $(mkinstalldirs) $$dc_destdir \ ?DISTCHECK-HOOK? && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ @@ -316,26 +319,21 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ -## We use -le 1 because the `dir' file might still exist after uninstall. - && (test `find "$$dc_install_base" -type f -print | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - find $$dc_install_base -type f -print ; \ - exit 1; } >&2 ) \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ ## Make sure the package has proper DESTDIR support (we could not test this ## in the previous install/installcheck/uninstall test, because it's reasonable -## for installcheck to fails in a DESTDIR install). +## for installcheck to fail in a DESTDIR install). ## We make the `$dc_install_base' read-only because this is where files ## with missing DESTDIR support are likely to be installed. && chmod -R a-w "$$dc_install_base" \ -## The logic here is quire convoluted because we must clean $dc_destdir +## The logic here is quite convoluted because we must clean $dc_destdir ## whatever happens (it won't be erased by the next run of distcheck like -## $(dirstir) is). +## $(distdir) is). && ({ $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && (test `find "$$dc_destdir" -type f -print | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall (check DESTDIR support):" ; \ - find "$$dc_destdir" -type f -print ; \ - exit 1; } >&2 ); \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ @@ -347,8 +345,24 @@ distcheck: dist @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' +## Define distuninstallcheck_listfiles and distuninstallcheck separately +## from distcheck, so that they can be overridden by the user. +.PHONY: distuninstallcheck +distuninstallcheck_listfiles = find . -type f -print +distuninstallcheck: +## We use -le 1 because the `dir' file might still exist after +## uninstall. + cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 + ## Define distcleancheck_listfiles and distcleancheck separately -## from distcheck, so that they can be overriden by the user. +## from distcheck, so that they can be overridden by the user. .PHONY: distcleancheck distcleancheck_listfiles = find . -type f -print distcleancheck: distclean @@ -1,4 +1,4 @@ -@set UPDATED 22 September 2002 +@set UPDATED 25 September 2002 @set UPDATED-MONTH September 2002 @set EDITION 1.6g @set VERSION 1.6g diff --git a/version.texi b/version.texi index e4420df3d..c701fcf51 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 22 September 2002 +@set UPDATED 25 September 2002 @set UPDATED-MONTH September 2002 @set EDITION 1.6g @set VERSION 1.6g |