automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiply distributed files


From: Ralf Wildenhues
Subject: Re: Multiply distributed files
Date: Fri, 19 May 2006 17:10:05 +0200
User-agent: Mutt/1.5.11

Hello Akim,

* Akim Demaille wrote on Fri, May 19, 2006 at 03:16:08PM CEST:
> 
> I have a Makefile snippet which is part of a directory which I ship as
> is (EXTRA_DIST) in my tarballs (something comparable to gnulib if you
> wish).  I include this Makefile snippet elsewhere, and as a result,
> Automake will distribute it.  Hence this file is "listed" twice to be
> shipped.
> 
> In such a setup distcheck will necessarily fail, because at one point
> we have read-only srcdir, and a use of cp -p, hence, when distdir
> tries to copy the directory, I have permission denied failure.  Am I
> clear enough?

Yep, you are.  Thanks for the bug report and the nice analysis!
(I think I've tripped over this before, but not realized the bug.)

OK to apply?

BTW, is there a reason we're making things writable for everyone in
distdir.am (several instances)?  Shouldn't `u+w' suffice?  I don't see
where other users might come into play here.  World-writable files
always give me the creeps, even if they may be below some directory 
accessible by the user only.  FWIW, a glance at the ChangeLogs didn't
turn up anything helpful on this matter, and

| 2001-02-21  Akim Demaille  <address@hidden>
| 
|    * distdir.am (distdir): Be sure to have permissive rights on its
|    contents.

is earlier than publicly available mailing list archives...

Cheers,
Ralf

2006-05-19  Akim Demaille  <address@hidden>,
            Ralf Wildenhues  <address@hidden>

        * lib/am/distdir.am (distcheck): Before the second `dist' part,
        make the source tree writable again, so that directories listed
        in `EXTRA_DIST' of more than one Makefile.am won't cause it to
        fail.
        * tests/distdir2.test: New test.
        * tests/Makefile.am: Update.
        Report and fix by Akim Demaille.

Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.64
diff -u -r1.64 distdir.am
--- lib/am/distdir.am   19 Mar 2006 05:04:28 -0000      1.64
+++ lib/am/distdir.am   19 May 2006 15:10:40 -0000
@@ -379,6 +379,7 @@
                    distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
              } || { rm -rf "$$dc_destdir"; exit 1; }) \
          && rm -rf "$$dc_destdir" \
+         && chmod -R a+w .. \
          && $(MAKE) $(AM_MAKEFLAGS) dist \
 ## Make sure to remove the dists we created in the test build directory.
          && rm -rf $(DIST_ARCHIVES) \
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.604
diff -u -r1.604 Makefile.am
--- tests/Makefile.am   10 May 2006 20:47:36 -0000      1.604
+++ tests/Makefile.am   19 May 2006 14:47:09 -0000
@@ -214,6 +214,7 @@
 distcom6.test \
 distcom7.test \
 distdir.test \
+distdir2.test \
 distname.test \
 dollar.test \
 double.test \
--- /dev/null   1970-01-01 00:00:01.000000000 +0200
+++ tests/distdir2.test 2006-05-19 17:05:27.000000000 +0200
@@ -0,0 +1,54 @@
+#! /bin/sh
+# Copyright (C) 1996, 2001, 2002, 2003, 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 to make sure subdirs in EXTRA_DIST work also with multiply
+# listed directories.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES(sub/Makefile)
+AC_OUTPUT
+END
+
+mkdir sub dir
+touch dir/foo
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+EXTRA_DIST = dir
+check-local:
+       test -f $(srcdir)/dir/foo
+END
+
+cat > sub/Makefile.am << 'END'
+EXTRA_DIST = ../dir
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure --prefix `pwd`
+$MAKE distcheck
+
+exit 0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]