2 # Ensure "install -C" works. (basic tests)
4 # Copyright (C) 2008 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 if test "$VERBOSE" = yes; then
32 echo test > a || framework_failure
33 echo "\`a' -> \`b'" > out_installed_first
35 \`a' -> \`b'" > out_installed_second
38 # destination file does not exist
39 ginstall -Cv -m$mode1 a b > out || fail=1
40 compare out out_installed_first || fail=1
42 # destination file exists
43 ginstall -Cv -m$mode1 a b > out || fail=1
44 compare out out_empty || fail=1
46 # destination file exists (long option)
47 ginstall -v --compare -m$mode1 a b > out || fail=1
48 compare out out_empty || fail=1
50 # destination file exists but -C is not given
51 ginstall -v -m$mode1 a b > out || fail=1
52 compare out out_installed_second || fail=1
54 # option -C ignored if any non-permission mode should be set
55 ginstall -Cv -m$mode3 a b > out || fail=1
56 compare out out_installed_second || fail=1
57 ginstall -Cv -m$mode3 a b > out || fail=1
58 compare out out_installed_second || fail=1
60 # files are not regular files
61 ln -s a c || framework_failure
62 ln -s b d || framework_failure
63 ginstall -Cv -m$mode1 c d > out || fail=1
65 \`c' -> \`d'" > out_installed_second_cd
66 compare out out_installed_second_cd || fail=1
68 # destination file exists but content differs
69 echo test1 > a || framework_failure
70 ginstall -Cv -m$mode1 a b > out || fail=1
71 compare out out_installed_second || fail=1
72 ginstall -Cv -m$mode1 a b > out || fail=1
73 compare out out_empty || fail=1
75 # destination file exists but content differs (same size)
76 echo test2 > a || framework_failure
77 ginstall -Cv -m$mode1 a b > out || fail=1
78 compare out out_installed_second || fail=1
79 ginstall -Cv -m$mode1 a b > out || fail=1
80 compare out out_empty || fail=1
82 # destination file exists but mode differs
83 ginstall -Cv -m$mode2 a b > out || fail=1
84 compare out out_installed_second || fail=1
85 ginstall -Cv -m$mode2 a b > out || fail=1
86 compare out out_empty || fail=1
88 # options -C and --preserve-timestamps are mutually exclusive
89 ginstall -C --preserve-timestamps a b && fail=1
91 # options -C and --strip are mutually exclusive
92 ginstall -C --strip --strip-program=echo a b && fail=1