[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Patch: Add uninstallcheck
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: Patch: Add uninstallcheck |
Date: |
Wed, 25 Sep 2002 15:25:23 +0200 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) |
I'm checking this in.
2002-09-25 Tom Tromey <address@hidden>
* 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.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.196
diff -u -r1.196 NEWS
--- NEWS 20 Sep 2002 11:20:02 -0000 1.196
+++ NEWS 25 Sep 2002 13:23:48 -0000
@@ -29,6 +29,9 @@
* 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:
Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.303
diff -u -r1.303 automake.texi
--- automake.texi 22 Sep 2002 14:56:27 -0000 1.303
+++ automake.texi 25 Sep 2002 13:23:53 -0000
@@ -4175,6 +4175,8 @@
@cindex make distcheck
@cindex make distcleancheck
@vindex distcleancheck_listfiles
address@hidden make distuninstallcheck
address@hidden distuninstallcheck_listfiles
Automake also generates a @code{distcheck} target which can be of help
to ensure that a given distribution will actually work.
@@ -4234,6 +4236,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.)
+
address@hidden 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
address@hidden(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
address@hidden For instance, to disable this check completely, you
+would write:
+
address@hidden
+distuninstallcheck:
+ @@:
address@hidden example
@section The types of distributions
Index: stamp-vti
===================================================================
RCS file: /cvs/automake/automake/stamp-vti,v
retrieving revision 1.210
diff -u -r1.210 stamp-vti
--- stamp-vti 22 Sep 2002 14:56:27 -0000 1.210
+++ stamp-vti 25 Sep 2002 13:23:58 -0000
@@ -1,4 +1,4 @@
address@hidden UPDATED 22 September 2002
address@hidden UPDATED 25 September 2002
@set UPDATED-MONTH September 2002
@set EDITION 1.6g
@set VERSION 1.6g
Index: version.texi
===================================================================
RCS file: /cvs/automake/automake/version.texi,v
retrieving revision 1.282
diff -u -r1.282 version.texi
--- version.texi 22 Sep 2002 14:56:27 -0000 1.282
+++ version.texi 25 Sep 2002 13:23:58 -0000
@@ -1,4 +1,4 @@
address@hidden UPDATED 22 September 2002
address@hidden UPDATED 25 September 2002
@set UPDATED-MONTH September 2002
@set EDITION 1.6g
@set VERSION 1.6g
Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.39
diff -u -r1.39 distdir.am
--- lib/am/distdir.am 23 Sep 2002 22:33:50 -0000 1.39
+++ lib/am/distdir.am 25 Sep 2002 13:23:59 -0000
@@ -303,6 +303,9 @@
## 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 @@
&& $(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 @@
@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
--
Alexandre Duret-Lutz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: Patch: Add uninstallcheck,
Alexandre Duret-Lutz <=