2 # Copyright (C) 2008-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Installing many files should not exceed the command line length limit.
19 # This is the python sister test of 'instmany.sh', see there for details.
25 subdir
=long_subdir_name_with_many_characters
27 list
=$
(seq_
1 $nfiles)
29 sed "s|@limit@|$limit|g" >myinstall.
in <<'END'
31 # Fake install script. This doesn't really install
32 # (the INSTALL path below would be wrong outside this directory).
35 len=`expr "$INSTALL $*" : ".*" 2>/dev/null || echo $limit`
36 if test $len -ge $limit; then
37 echo "$0: safe command line limit of $limit characters exceeded" >&2
43 # Creative quoting in the next line to please maintainer-check.
44 sed "s|@limit@|$limit|g" >'rm' <<'END'
50 len=`expr "$RM $*" : ".*" 2>/dev/null || echo $limit`
51 if test $len -ge $limit; then
52 echo "$0: safe command line limit of $limit characters exceeded" >&2
61 cat >>configure.ac
<<END
63 AC_CONFIG_FILES([myinstall], [chmod +x ./myinstall])
64 AC_CONFIG_FILES([$subdir/Makefile])
68 cat >Makefile.am
<<END
75 cat >Makefile.am
<<'END'
77 nobase_python_PYTHON =
81 unindent
>>Makefile.am
<<END
82 python_PYTHON += python$n.py
83 nobase_python_PYTHON += npython$n.py
92 $AUTOMAKE --add-missing
97 ..
/configure
--prefix="$instdir"
99 # Try whether native install (or install-sh) works.
101 # Multiple uninstall should work, too.
104 test $
(find "$instdir" -type f
-print |
wc -l) -eq 0
106 # Try whether we don't exceed the low limit.
107 INSTALL
='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
108 env save_PATH
="$PATH" PATH
="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
113 # Ensure 'make install' fails when 'install' fails.
115 for file in python3.py python
$nfiles.py
117 chmod a-r
$srcdir/$file
118 test ! -r $srcdir/$file || skip_
"cannot drop file read permissions"
119 $MAKE install && exit 1
120 chmod u
+r
$srcdir/$file
123 for file in npython3.py npython
$nfiles.py
125 chmod a-r
$srcdir/$file
126 $MAKE install && exit 1
127 chmod u
+r
$srcdir/$file