automake
[Top][All Lists]
Advanced

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

Re: AMTAR brokenness


From: Alexandre Duret-Lutz
Subject: Re: AMTAR brokenness
Date: Tue, 20 Apr 2004 22:34:01 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "Paul" == Paul Eggert <address@hidden> writes:

[...]

 Paul> Many tar implementations have trouble with path names longer than 99
 Paul> bytes.  This includes the current GNU tar official latest non-alpha
 Paul> release (which is buggy in this area).  It would be reasonable to add
 Paul> an automake option that checks for longer-than-99-byte file names, for
 Paul> people who are worried about such things.  But I don't think it needs
 Paul> to be high priority.

I've prepared this.  However I'm not really proud of the name
`filenames-99'.  Maybe someone can suggest some nicer name?

2004-04-20  Alexandre Duret-Lutz  <address@hidden>

        For PR automake/414:
        Introduce option filenames-99.
        * doc/automake.texi (Options): Document it.
        * configure.ac (AM_INIT_AUTOMAKE): Use it.
        * lib/Automake/Options.pm (_process_option_list): Recognize it.
        * automake.in (handle_dist): Set FILENAMES_99.
        * lib/am/distdir.am (distdir) [FILENAMES_99]: Diagnose long
        filenames.
        * tests/fn99.test: New file.
        * tests/Makefile.am (TESTS): Add fn99.test.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.268
diff -u -r1.268 NEWS
--- NEWS        19 Apr 2004 23:20:07 -0000      1.268
+++ NEWS        20 Apr 2004 20:30:56 -0000
@@ -45,8 +45,8 @@
 * Diagnose AC_CONFIG_AUX_DIR calls following AM_INIT_AUTOMAKE. (PR/49)
 
 * Tar format can be chosen with the new options tar-v7, tar-ustar, and
-  tar-pax.
-
+  tar-pax.  The new option filenames-99 helps diagnosing filenames
+  that are too long for tar-v7.
 
 New in 1.8:
 
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1553
diff -u -r1.1553 automake.in
--- automake.in 17 Apr 2004 18:46:05 -0000      1.1553
+++ automake.in 20 Apr 2004 20:31:00 -0000
@@ -3500,7 +3500,8 @@
 
   $output_rules .= &file_contents ('distdir',
                                   new Automake::Location,
-                                  %transform);
+                                  %transform,
+                                  FILENAMES_99 => !! option 'filenames-99');
 }
 
 
Index: configure.ac
===================================================================
RCS file: /cvs/automake/automake/configure.ac,v
retrieving revision 1.14
diff -u -r1.14 configure.ac
--- configure.ac        10 Apr 2004 17:18:01 -0000      1.14
+++ configure.ac        20 Apr 2004 20:31:02 -0000
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 
-# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
 # Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -36,7 +36,7 @@
 # bothered by `missing'.
 am_AUTOCONF=${AUTOCONF-autoconf}
 
-AM_INIT_AUTOMAKE([1.6 dist-bzip2])
+AM_INIT_AUTOMAKE([1.6 dist-bzip2 filenames-99])
 
 # The API version is the base version.  We must guarantee
 # compatibility for all releases with the same API version.
Index: doc/automake.texi
===================================================================
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.32
diff -u -r1.32 automake.texi
--- doc/automake.texi   19 Apr 2004 23:20:07 -0000      1.32
+++ doc/automake.texi   20 Apr 2004 20:31:07 -0000
@@ -5812,6 +5812,16 @@
 Hook @code{dist-tarZ} to @code{dist}.
 @trindex dist-tarZ
 
address@hidden @code{filenames-99}
address@hidden Option, filenames-99
address@hidden filenames-99
+Abort if filenames longer than 99 characters are found during
address@hidden dist}.  Such long filenames are generally considered not to
+be portable in tarballs.  See the @code{tar-v7} and @code{tar-ustar}
+options below.  This option should be used in the top-level
address@hidden or as an argument of @code{AM_INIT_AUTOMAKE} in
address@hidden, it will be ignored otherwise.
+
 @item @code{no-define}
 @cindex Option, no-define
 This options is meaningful only when passed as an argument to
@@ -5919,6 +5929,17 @@
 @item @code{tar-v7}
 @itemx @code{tar-ustar}
 @itemx @code{tar-pax}
address@hidden Option, tar-v7
address@hidden Option, tar-ustar
address@hidden Option, tar-pax
address@hidden tar formats
address@hidden v7 tar format
address@hidden ustar format
address@hidden pax format
address@hidden tar-v7
address@hidden tar-ustar
address@hidden tar-pax
+
 These three mutually exclusive options select the tar format to use
 when generating tarballs with @code{make dist}.  (The tar file created
 is then compressed according to the set of @code{no-dist-gzip},
@@ -5935,7 +5956,8 @@
 given longer filenames some tar implementations will diagnose the
 problem while other will generate broken tarballs or use non-portable
 extensions.  Furthermore, the V7 format cannot store empty
-directories.
+directories.  When using this format, consider using the
address@hidden option to catch filenames too long.
 
 @code{tar-ustar} selects the ustar format defined by POSIX
 1003.1-1988.  This format is believed to be old enough to be portable.
Index: lib/Automake/Options.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Options.pm,v
retrieving revision 1.3
diff -u -r1.3 Options.pm
--- lib/Automake/Options.pm     19 Apr 2004 23:20:07 -0000      1.3
+++ lib/Automake/Options.pm     20 Apr 2004 20:31:08 -0000
@@ -266,7 +266,7 @@
             || $_ eq 'readme-alpha' || $_ eq 'check-news'
             || $_ eq 'subdir-objects' || $_ eq 'nostdinc'
             || $_ eq 'no-exeext' || $_ eq 'no-define'
-            || $_ eq 'std-options'
+            || $_ eq 'std-options' || $_ eq 'filenames-99'
             || $_ eq 'cygnus' || $_ eq 'no-dependencies')
        {
          # Explicitly recognize these.
Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.57
diff -u -r1.57 distdir.am
--- lib/am/distdir.am   19 Apr 2004 23:20:08 -0000      1.57
+++ lib/am/distdir.am   20 Apr 2004 20:32:20 -0000
@@ -212,8 +212,14 @@
          ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
          ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} 
\; \
        || chmod -R a+r $(distdir)
+if %?FILENAMES_99%
+       @if find $(distdir) -type f -print | \
+         grep 
'^....................................................................................................'
 1>&2; then \
+         echo 'error: the above filenames use more than 99 characters' 1>&2; \
+         exit 1; \
+       else :; fi
+endif %?FILENAMES_99%
 endif %?TOPDIR_P%
-
 
 
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.557
diff -u -r1.557 Makefile.am
--- tests/Makefile.am   19 Apr 2004 23:20:08 -0000      1.557
+++ tests/Makefile.am   20 Apr 2004 20:32:21 -0000
@@ -217,6 +217,7 @@
 extra7.test \
 f90only.test \
 flibs.test \
+fn99.test \
 fnoc.test \
 fo.test        \
 fonly.test \
Index: tests/fn99.test
===================================================================
RCS file: tests/fn99.test
diff -N tests/fn99.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/fn99.test     20 Apr 2004 20:32:21 -0000
@@ -0,0 +1,58 @@
+#! /bin/sh
+# Copyright (C) 2004  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., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check the filenames-99 option.
+
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat >Makefile.am <<'END'
+AUTOMAKE_OPTIONS = filenames-99
+EXTRA_DIST = 12345678
+END
+
+(for i in 1 2 3 4 5 6 7 8 9
+do
+  mkdir -p 12345678 || exit 77
+  cd 12345678
+  touch x
+done)
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE distcheck
+
+(for i in 1 2 3 4 5 6 7 8 9 10 11
+do
+  mkdir -p 12345678 || exit 77
+  cd 12345678
+  touch x
+done)
+
+$MAKE dist 2>stderr && exit 1
+cat stderr
+grep 'more than 99' stderr
+test 2 = `grep 12345678 stderr | wc -l`
+:
-- 
Alexandre Duret-Lutz





reply via email to

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