From: Alexandre Duret-Lutz Date: Wed, 25 Sep 2002 13:25:53 +0000 (+0000) Subject: * NEWS: Mention distuninstallcheck. X-Git-Tag: Release-1-7~6 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=d9296d15383ee365e482e50480cbca0bde22a566;p=automake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 8e15c112..c48e28d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-09-25 Tom Tromey + + * 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 * tests/specflags7.test (true_CFLAGS, false_CFLAGS, false.c): Use diff --git a/NEWS b/NEWS index 55ab0010..4a8e756f 100644 --- a/NEWS +++ b/NEWS @@ -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 90925299..1ddff23f 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 7ee940ee..946a96d1 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 diff --git a/stamp-vti b/stamp-vti index e4420df3..c701fcf5 100644 --- a/stamp-vti +++ b/stamp-vti @@ -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 e4420df3..c701fcf5 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