[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ensure that generated files are read-only
From: |
Ralf Wildenhues |
Subject: |
Re: ensure that generated files are read-only |
Date: |
Fri, 8 Sep 2006 19:56:38 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
[ let's drop bug-gnulib ]
* Simon Josefsson wrote on Fri, Sep 08, 2006 at 11:30:42AM CEST:
> Bruce Korb <address@hidden> writes:
> >
> > May I encourage you to use distcheck-clean? There is less to remember.
> > "distdir" may be the directory that gets cleaned up, but the problem
> > stems essentially entirely from a "make distcheck" failure, so the
> > cleanup rule should be named after that failing rule. That, or alias
> > them. :) Thanks - Bruce
>
> I kind of agree with that. Further, it allows me to use arrow-up to
> recall the 'make distclean' and then just add '-clean'. That's quite
> nice.
(FWIW, you meant s/distclean/distcheck/, I guess.)
Updated patch below, including a typo fix in the test. I'll give
Alexandre some more days to complain, before applying.
Related question: shouldn't maintainer-clean (in the toplevel Makefile)
depend upon distdir-clean also?
Cheers,
Ralf
* lib/am/distdir (distdir-clean, distcheck-clean): New targets.
* doc/automake.texi (Dist): New section `When something goes
wrong'.
* tests/distdir2.test: New test.
* tests/Makefile.am: Update.
* NEWS: Update.
Suggested by Simon Josefsson.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.315
diff -u -r1.315 NEWS
--- NEWS 5 Sep 2006 18:58:16 -0000 1.315
+++ NEWS 8 Sep 2006 17:20:26 -0000
@@ -6,6 +6,9 @@
a package to work correctly. The permissions may have been lost
by work of a patch or version control tool.
+ - New target `distdir-clean' aka. `distcheck-clean' to clean up
+ left-over files after an incomplete `dist-*' or `distcheck'.
+
New in 1.9b:
* Version requirements:
Index: doc/automake.texi
===================================================================
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.150
diff -u -r1.150 automake.texi
--- doc/automake.texi 28 Aug 2006 16:04:24 -0000 1.150
+++ doc/automake.texi 8 Sep 2006 17:20:28 -0000
@@ -8194,6 +8219,18 @@
create archives in all the enabled formats, @ref{Options}. By
default, only the @code{dist-gzip} target is hooked to @code{dist}.
address@hidden When something does wrong
+
address@hidden @samp{make distdir-clean}
address@hidden @samp{make distcheck-clean}
+
address@hidden distdir-clean
address@hidden distcheck-clean
+Sometimes one of the @code{dist-*} or @code{distcheck} rules may stop with
+an error, leaving you behind with leftover files. You can use the
address@hidden (or @code{distcheck-clean}) rule from your top-level
+directory in order to clean up after these rules.
+
@node Tests
@chapter Support for test suites
Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.68
diff -u -r1.68 distdir.am
--- lib/am/distdir.am 19 Aug 2006 15:55:52 -0000 1.68
+++ lib/am/distdir.am 8 Sep 2006 17:20:19 -0000
@@ -225,6 +225,11 @@
endif %?FILENAME_FILTER%
endif %?TOPDIR_P%
+if %?TOPDIR_P%
+.PHONY: distdir-clean distcheck-clean
+distdir-clean distcheck-clean:
+ $(am__remove_distdir)
+endif %?TOPDIR_P%
## --------------------------------------- ##
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.609
diff -u -r1.609 Makefile.am
--- tests/Makefile.am 30 Aug 2006 20:35:56 -0000 1.609
+++ tests/Makefile.am 8 Sep 2006 17:20:28 -0000
@@ -215,6 +215,7 @@
distcom6.test \
distcom7.test \
distdir.test \
+distdir2.test \
distname.test \
dollar.test \
double.test \
--- /dev/null 2006-05-22 13:44:12.000000000 +0200
+++ tests/distdir2.test 2006-09-08 19:10:27.000000000 +0200
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test distdir-clean.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+cat > Makefile.am << 'END'
+TESTS = foo
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+# Fails because `foo' is missing, with read-only leftover.
+$MAKE distcheck && exit 1
+
+$MAKE distdir-clean
+test ! -d distdir2-1.0
+
+exit 0