Introduce option filename-length-max=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 FILENAME_FILTER.
* lib/am/distdir.am (distdir) [FILENAME_FILTER]: Diagnose long
filenames.
* tests/fn99.test: New file.
* tests/Makefile.am (TESTS): Add fn99.test.
+2004-04-23 Alexandre Duret-Lutz <adl@gnu.org>
+
+ For PR automake/414:
+ Introduce option filename-length-max=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 FILENAME_FILTER.
+ * lib/am/distdir.am (distdir) [FILENAME_FILTER]: Diagnose long
+ filenames.
+ * tests/fn99.test: New file.
+ * tests/Makefile.am (TESTS): Add fn99.test.
+
2004-04-20 Alexandre Duret-Lutz <adl@gnu.org>
For PR automake/414:
! -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 find $(distdir) -type f -print | \
+ grep '^...................................................................................................' 1>&2; then \
+ echo 'error: the above filenames are too long' 1>&2; \
+ exit 1; \
+ else :; fi
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
* 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 filename-length-max=99 helps diagnosing
+ filenames that are too long for tar-v7.
\f
New in 1.8:
if rule 'dist-hook';
$transform{'DIST-TARGETS'} = join(' ', @dist_targets);
+ my $flm = option ('filename-length-max');
+ my $filename_filter = $flm ? '.' x $flm->[1] : '';
+
$output_rules .= &file_contents ('distdir',
new Automake::Location,
- %transform);
+ %transform,
+ FILENAME_FILTER => $filename_filter);
}
# Test for things needed by the test suite.
echo "$as_me:$LINENO: checking for grep that handles long lines" >&5
echo $ECHO_N "checking for grep that handles long lines... $ECHO_C" >&6
-if test "${oc_cv_path_GREP+set}" = set; then
+if test "${ac_cv_path_GREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# Extract the first word of "grep ggrep" to use in msg output
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
{ (exit 1); exit 1; }
}
+ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
test -f "$ac_path_GREP" || continue
- if $as_executable_p "$ac_path_GREP"; then
+ $ac_path_GREP_found || if $as_executable_p "$ac_path_GREP"; then
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
if "$ac_path_GREP" --version 2>&1 < /dev/null | grep 'GNU' >/dev/null; then
- ac_cv_path_GREP="$ac_path_GREP"
- break 2
-
-fi
-
-
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:
+else
ac_count=0
echo $ECHO_N "0123456789$ECHO_C" >"$tmp/conftest.in"
while :
cp "$tmp/conftest.in" "$tmp/conftest.nl"
echo 'GREP' >> "$tmp/conftest.nl"
"$ac_path_GREP" 'GREP$' < "$tmp/conftest.nl" >"$tmp/conftest.out" || break
- diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
+ diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_max-0}; then
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
- ac_max=$ac_count
+ ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
fi
+fi
+
+ $ac_path_GREP_found && break 3
done
done
+
done
rm -rf "$tmp"
fi
-echo "$as_me:$LINENO: result: $oc_cv_path_GREP" >&5
-echo "${ECHO_T}$oc_cv_path_GREP" >&6
+echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6
GREP="$ac_cv_path_GREP"
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
{ (exit 1); exit 1; }
}
+ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
test -f "$ac_path_EGREP" || continue
- if $as_executable_p "$ac_path_EGREP"; then
+ $ac_path_EGREP_found || if $as_executable_p "$ac_path_EGREP"; then
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
if "$ac_path_EGREP" --version 2>&1 < /dev/null | grep 'GNU' >/dev/null; then
- ac_cv_path_EGREP="$ac_path_EGREP"
- break 2
-
-fi
-
-
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:
+else
ac_count=0
echo $ECHO_N "0123456789$ECHO_C" >"$tmp/conftest.in"
while :
cp "$tmp/conftest.in" "$tmp/conftest.nl"
echo 'EGREP' >> "$tmp/conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "$tmp/conftest.nl" >"$tmp/conftest.out" || break
- diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
+ diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_max-0}; then
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
- ac_max=$ac_count
+ ac_path_EGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
fi
+fi
+
+ $ac_path_EGREP_found && break 3
done
done
+
done
rm -rf "$tmp"
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
{ (exit 1); exit 1; }
}
+ac_path_FGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
test -f "$ac_path_FGREP" || continue
- if $as_executable_p "$ac_path_FGREP"; then
+ $ac_path_FGREP_found || if $as_executable_p "$ac_path_FGREP"; then
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
if "$ac_path_FGREP" --version 2>&1 < /dev/null | grep 'GNU' >/dev/null; then
- ac_cv_path_FGREP="$ac_path_FGREP"
- break 2
-
-fi
-
-
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:
+else
ac_count=0
echo $ECHO_N "0123456789$ECHO_C" >"$tmp/conftest.in"
while :
mv "$tmp/conftest.tmp" "$tmp/conftest.in"
cp "$tmp/conftest.in" "$tmp/conftest.nl"
echo 'FGREP' >> "$tmp/conftest.nl"
- "$ac_path_FGREP" 'FGREP$' < "$tmp/conftest.nl" >"$tmp/conftest.out" || break
- diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
+ "$ac_path_FGREP" 'FGREP' < "$tmp/conftest.nl" >"$tmp/conftest.out" || break
+ diff "$tmp/conftest.out" "$tmp/conftest.nl" >/dev/null 2>&1 || break
ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_max-0}; then
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_FGREP="$ac_path_FGREP"
- ac_max=$ac_count
+ ac_path_FGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
fi
+fi
+
+ $ac_path_FGREP_found && break 3
done
done
+
done
rm -rf "$tmp"
# 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
# bothered by `missing'.
am_AUTOCONF=${AUTOCONF-autoconf}
-AM_INIT_AUTOMAKE([1.6 dist-bzip2])
+AM_INIT_AUTOMAKE([1.6 dist-bzip2 filename-length-max=99])
# The API version is the base version. We must guarantee
# compatibility for all releases with the same API version.
Hook @code{dist-tarZ} to @code{dist}.
@trindex dist-tarZ
+@item @code{filename-length-max=99}
+@cindex Option, filename-length-max=99
+@trindex filename-length-max=99
+Abort if filenames longer than 99 characters are found during
+@code{make 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
+@file{Makefile.am} or as an argument of @code{AM_INIT_AUTOMAKE} in
+@file{configure.ac}, it will be ignored otherwise.
+
@item @code{no-define}
@cindex Option, no-define
This options is meaningful only when passed as an argument to
@item @code{tar-v7}
@itemx @code{tar-ustar}
@itemx @code{tar-pax}
+@cindex Option, tar-v7
+@cindex Option, tar-ustar
+@cindex Option, tar-pax
+@cindex tar formats
+@cindex v7 tar format
+@cindex ustar format
+@cindex pax format
+@trindex tar-v7
+@trindex tar-ustar
+@trindex 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},
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
+@code{filename-length-max=99} 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.
-@set UPDATED 20 April 2004
+@set UPDATED 23 April 2004
@set UPDATED-MONTH April 2004
@set EDITION 1.8a
@set VERSION 1.8a
-@set UPDATED 20 April 2004
+@set UPDATED 23 April 2004
@set UPDATED-MONTH April 2004
@set EDITION 1.8a
@set VERSION 1.8a
{
# Explicitly recognize these.
}
+ elsif ($_ =~ /^filename-length-max=(\d+)$/)
+ {
+ delete $options->{$_};
+ $options->{'filename-length-max'} = [$_, $1];
+ }
elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax')
{
error ($where,
! -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 %?FILENAME_FILTER%
+ @if find $(distdir) -type f -print | \
+ grep '^%FILENAME_FILTER%' 1>&2; then \
+ echo 'error: the above filenames are too long' 1>&2; \
+ exit 1; \
+ else :; fi
+endif %?FILENAME_FILTER%
endif %?TOPDIR_P%
-
## --------------------------------------- ##
## Building various distribution flavors. ##
## --------------------------------------- ##
extra7.test \
f90only.test \
flibs.test \
+fn99.test \
fnoc.test \
fo.test \
fonly.test \
extra7.test \
f90only.test \
flibs.test \
+fn99.test \
fnoc.test \
fo.test \
fonly.test \
--- /dev/null
+#! /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 filename-length-max=99 option.
+
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat >Makefile.am <<'END'
+AUTOMAKE_OPTIONS = filename-length-max=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 'filenames are too long' stderr
+test 2 = `grep 12345678 stderr | wc -l`
+: