2 # Copyright (C) 2002-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 # Various install-sh checks.
19 am_create_testdir
=empty
22 get_shell_script install-sh
25 .
/install-sh
&& exit 1
26 .
/install-sh
-m 644 dest
&& exit 1
30 # It should be OK to create no directory. We sometimes need
31 # this when directory are conditionally defined.
36 # Multiple directories (for make installdirs).
37 .
/install-sh
-d d1 d2 d3 d4
43 .
/install-sh
-d p
1/p
2/p3 p
4//p
5//p
6//
49 .
/install-sh
-c -m 644 x y
52 .
/install-sh
-m 644 y z
56 .
/install-sh
-m 644 -c x z d1
61 .
/install-sh
-m 644 x z d
2//
66 .
/install-sh
-t d3
-m 644 x z
71 .
/install-sh
-t d
4// -m 644 x z
76 .
/install-sh
-T x d
3/y
79 .
/install-sh
-T x d3
&& exit 1
80 .
/install-sh
-T x d
4// && exit 1
82 # Ensure that install-sh works with names that include spaces.
85 .
/install-sh
'a b' 'x y'
89 # Ensure we do not run into 'test' operator precedence bugs with Tru64 sh.
90 for c
in = '(' ')' '!'; do
91 .
/install-sh
$c 2>stderr
&& { cat stderr
>&2; exit 1; }
93 grep 'test: ' stderr
&& exit 1
94 # Skip tests if the file system is not capable.
95 mkdir .
/$c ||
continue
97 .
/install-sh
-d $c/$c/$c
99 .
/install-sh
-d $c d
5/$c/$c
108 ( : > .
/$c ) ||
continue
109 .
/install-sh
$c x d
5/$c/$c
113 .
/install-sh
-t d
5/$c/$c $c x