2 # Copyright (C) 2008-2013 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 oPATH=$PATH; export oPATH
30 nPATH=$(pwd)/x-bin$PATH_SEPARATOR$PATH; export nPATH
34 sed "s|@limit@|$limit|g" >x-bin/my-install <<'END'
36 # Fake install script. This doesn't really install
37 # (the INSTALL path below would be wrong outside this directory).
39 PATH=$oPATH; export PATH
40 if test -z "$orig_INSTALL"; then
41 echo "$0: \$orig_INSTALL variable not set" >&2
44 len=`expr "$orig_INSTALL $*" : ".*" 2>/dev/null || echo $limit`
45 if test $len -ge $limit; then
46 echo "$0: safe command line limit of $limit characters exceeded" >&2
49 exec $orig_INSTALL "$@"
53 # Creative quoting in the next line to please maintainer-check.
54 sed "s|@limit@|$limit|g" >x-bin/'rm' <<'END'
57 PATH=$oPATH; export PATH
59 len=`expr "$RM $*" : ".*" 2>/dev/null || echo $limit`
60 if test $len -ge $limit; then
61 echo "$0: safe command line limit of $limit characters exceeded" >&2
68 # Creative quoting in the next line to please maintainer-check.
69 chmod +x x-bin/'rm' x-bin/my-install
71 cat > setenv.in <<'END'
72 orig_INSTALL='@INSTALL@'; export orig_INSTALL
75 cat >>configure.ac <<END
77 AC_CONFIG_FILES([setenv.sh:setenv.in])
78 AC_CONFIG_FILES([$subdir/Makefile])
82 cat >Makefile.am <<END
89 cat >Makefile.am <<'END'
91 nobase_python_PYTHON =
95 unindent >>Makefile.am <<END
96 python_PYTHON += python$n.py
97 nobase_python_PYTHON += npython$n.py
106 $AUTOMAKE --add-missing
111 ../configure --prefix="$instdir"
113 test -n "$orig_INSTALL"
115 # Try whether native install (or install-sh) works.
117 test -n "$(find "$instdir" -name python1.py)"
118 # Multiple uninstall should work, too.
121 test $(find "$instdir" -type f -print | wc -l) -eq 0
123 # Try whether we don't exceed the low limit.
124 PATH=$nPATH; export PATH
125 run_make INSTALL=my-install install
126 test -n "$(find "$instdir" -name python1.py)"
127 run_make INSTALL=my-install uninstall
128 test $(find "$instdir" -type f -print | wc -l) -eq 0
129 PATH=$oPATH; export PATH
134 # Ensure 'make install' fails when 'install' fails.
136 for file in python3.py python$nfiles.py
138 chmod a-r $srcdir/$file
139 test ! -r $srcdir/$file || skip_ "cannot drop file read permissions"
140 $MAKE install && exit 1
141 chmod u+r $srcdir/$file
144 for file in npython3.py npython$nfiles.py
146 chmod a-r $srcdir/$file
147 $MAKE install && exit 1
148 chmod u+r $srcdir/$file