annotate install-sh @ 3005:522ef24b0aba default tip

GTK4: Fix even more deprecation warnings in GTK 4.10 and later. Migrate to GtkAlertDialog for 4.10 from GtkMessageDialog. Still need to center the dialog or something.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 20 Dec 2023 05:17:54 +0000
parents 83c17a84bc27
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2970
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
1 #!/usr/bin/sh
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
2 # install - install a program, script, or datafile
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
3
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
4 scriptversion=2020-11-14.01; # UTC
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
5
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
6 # This originates from X11R5 (mit/util/scripts/install.sh), which was
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
7 # later released in X11R6 (xc/config/util/install.sh) with the
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
8 # following copyright and license.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
9 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
10 # Copyright (C) 1994 X Consortium
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
11 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
12 # Permission is hereby granted, free of charge, to any person obtaining a copy
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
13 # of this software and associated documentation files (the "Software"), to
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
14 # deal in the Software without restriction, including without limitation the
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
15 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
16 # sell copies of the Software, and to permit persons to whom the Software is
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
17 # furnished to do so, subject to the following conditions:
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
18 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
19 # The above copyright notice and this permission notice shall be included in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
20 # all copies or substantial portions of the Software.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
21 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
23 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
24 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
25 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
26 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
27 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
28 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
29 # Except as contained in this notice, the name of the X Consortium shall not
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
30 # be used in advertising or otherwise to promote the sale, use or other deal-
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
31 # ings in this Software without prior written authorization from the X Consor-
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
32 # tium.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
33 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
34 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
35 # FSF changes to this file are in the public domain.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
36 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
37 # Calling this script install-sh is preferred over install.sh, to prevent
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
38 # 'make' implicit rules from creating a file called install from it
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
39 # when there is no Makefile.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
40 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
41 # This script is compatible with the BSD install script, but was written
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
42 # from scratch.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
43
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
44 tab=' '
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
45 nl='
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
46 '
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
47 IFS=" $tab$nl"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
48
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
49 # Set DOITPROG to "echo" to test this script.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
50
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
51 doit=${DOITPROG-}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
52 doit_exec=${doit:-exec}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
53
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
54 # Put in absolute file names if you don't have them in your path;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
55 # or use environment vars.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
56
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
57 chgrpprog=${CHGRPPROG-chgrp}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
58 chmodprog=${CHMODPROG-chmod}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
59 chownprog=${CHOWNPROG-chown}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
60 cmpprog=${CMPPROG-cmp}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
61 cpprog=${CPPROG-cp}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
62 mkdirprog=${MKDIRPROG-mkdir}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
63 mvprog=${MVPROG-mv}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
64 rmprog=${RMPROG-rm}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
65 stripprog=${STRIPPROG-strip}
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
66
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
67 posix_mkdir=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
68
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
69 # Desired mode of installed file.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
70 mode=0755
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
71
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
72 # Create dirs (including intermediate dirs) using mode 755.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
73 # This is like GNU 'install' as of coreutils 8.32 (2020).
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
74 mkdir_umask=22
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
75
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
76 backupsuffix=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
77 chgrpcmd=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
78 chmodcmd=$chmodprog
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
79 chowncmd=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
80 mvcmd=$mvprog
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
81 rmcmd="$rmprog -f"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
82 stripcmd=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
83
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
84 src=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
85 dst=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
86 dir_arg=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
87 dst_arg=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
88
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
89 copy_on_change=false
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
90 is_target_a_directory=possibly
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
91
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
92 usage="\
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
93 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
94 or: $0 [OPTION]... SRCFILES... DIRECTORY
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
95 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
96 or: $0 [OPTION]... -d DIRECTORIES...
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
97
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
98 In the 1st form, copy SRCFILE to DSTFILE.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
99 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
100 In the 4th, create DIRECTORIES.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
101
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
102 Options:
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
103 --help display this help and exit.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
104 --version display version info and exit.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
105
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
106 -c (ignored)
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
107 -C install only if different (preserve data modification time)
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
108 -d create directories instead of installing files.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
109 -g GROUP $chgrpprog installed files to GROUP.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
110 -m MODE $chmodprog installed files to MODE.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
111 -o USER $chownprog installed files to USER.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
112 -p pass -p to $cpprog.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
113 -s $stripprog installed files.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
114 -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
115 -t DIRECTORY install into DIRECTORY.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
116 -T report an error if DSTFILE is a directory.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
117
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
118 Environment variables override the default commands:
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
119 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
120 RMPROG STRIPPROG
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
121
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
122 By default, rm is invoked with -f; when overridden with RMPROG,
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
123 it's up to you to specify -f if you want it.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
124
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
125 If -S is not specified, no backups are attempted.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
126
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
127 Email bug reports to bug-automake@gnu.org.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
128 Automake home page: https://www.gnu.org/software/automake/
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
129 "
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
130
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
131 while test $# -ne 0; do
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
132 case $1 in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
133 -c) ;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
134
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
135 -C) copy_on_change=true;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
136
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
137 -d) dir_arg=true;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
138
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
139 -g) chgrpcmd="$chgrpprog $2"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
140 shift;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
141
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
142 --help) echo "$usage"; exit $?;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
143
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
144 -m) mode=$2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
145 case $mode in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
146 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
147 echo "$0: invalid mode: $mode" >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
148 exit 1;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
149 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
150 shift;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
151
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
152 -o) chowncmd="$chownprog $2"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
153 shift;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
154
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
155 -p) cpprog="$cpprog -p";;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
156
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
157 -s) stripcmd=$stripprog;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
158
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
159 -S) backupsuffix="$2"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
160 shift;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
161
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
162 -t)
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
163 is_target_a_directory=always
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
164 dst_arg=$2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
165 # Protect names problematic for 'test' and other utilities.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
166 case $dst_arg in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
167 -* | [=\(\)!]) dst_arg=./$dst_arg;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
168 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
169 shift;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
170
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
171 -T) is_target_a_directory=never;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
172
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
173 --version) echo "$0 $scriptversion"; exit $?;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
174
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
175 --) shift
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
176 break;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
177
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
178 -*) echo "$0: invalid option: $1" >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
179 exit 1;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
180
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
181 *) break;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
182 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
183 shift
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
184 done
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
185
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
186 # We allow the use of options -d and -T together, by making -d
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
187 # take the precedence; this is for compatibility with GNU install.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
188
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
189 if test -n "$dir_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
190 if test -n "$dst_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
191 echo "$0: target directory not allowed when installing a directory." >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
192 exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
193 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
194 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
195
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
196 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
197 # When -d is used, all remaining arguments are directories to create.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
198 # When -t is used, the destination is already specified.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
199 # Otherwise, the last argument is the destination. Remove it from $@.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
200 for arg
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
201 do
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
202 if test -n "$dst_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
203 # $@ is not empty: it contains at least $arg.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
204 set fnord "$@" "$dst_arg"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
205 shift # fnord
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
206 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
207 shift # arg
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
208 dst_arg=$arg
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
209 # Protect names problematic for 'test' and other utilities.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
210 case $dst_arg in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
211 -* | [=\(\)!]) dst_arg=./$dst_arg;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
212 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
213 done
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
214 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
215
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
216 if test $# -eq 0; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
217 if test -z "$dir_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
218 echo "$0: no input file specified." >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
219 exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
220 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
221 # It's OK to call 'install-sh -d' without argument.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
222 # This can happen when creating conditional directories.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
223 exit 0
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
224 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
225
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
226 if test -z "$dir_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
227 if test $# -gt 1 || test "$is_target_a_directory" = always; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
228 if test ! -d "$dst_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
229 echo "$0: $dst_arg: Is not a directory." >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
230 exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
231 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
232 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
233 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
234
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
235 if test -z "$dir_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
236 do_exit='(exit $ret); exit $ret'
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
237 trap "ret=129; $do_exit" 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
238 trap "ret=130; $do_exit" 2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
239 trap "ret=141; $do_exit" 13
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
240 trap "ret=143; $do_exit" 15
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
241
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
242 # Set umask so as not to create temps with too-generous modes.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
243 # However, 'strip' requires both read and write access to temps.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
244 case $mode in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
245 # Optimize common cases.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
246 *644) cp_umask=133;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
247 *755) cp_umask=22;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
248
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
249 *[0-7])
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
250 if test -z "$stripcmd"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
251 u_plus_rw=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
252 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
253 u_plus_rw='% 200'
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
254 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
255 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
256 *)
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
257 if test -z "$stripcmd"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
258 u_plus_rw=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
259 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
260 u_plus_rw=,u+rw
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
261 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
262 cp_umask=$mode$u_plus_rw;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
263 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
264 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
265
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
266 for src
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
267 do
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
268 # Protect names problematic for 'test' and other utilities.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
269 case $src in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
270 -* | [=\(\)!]) src=./$src;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
271 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
272
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
273 if test -n "$dir_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
274 dst=$src
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
275 dstdir=$dst
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
276 test -d "$dstdir"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
277 dstdir_status=$?
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
278 # Don't chown directories that already exist.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
279 if test $dstdir_status = 0; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
280 chowncmd=""
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
281 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
282 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
283
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
284 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
285 # might cause directories to be created, which would be especially bad
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
286 # if $src (and thus $dsttmp) contains '*'.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
287 if test ! -f "$src" && test ! -d "$src"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
288 echo "$0: $src does not exist." >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
289 exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
290 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
291
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
292 if test -z "$dst_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
293 echo "$0: no destination specified." >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
294 exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
295 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
296 dst=$dst_arg
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
297
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
298 # If destination is a directory, append the input filename.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
299 if test -d "$dst"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
300 if test "$is_target_a_directory" = never; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
301 echo "$0: $dst_arg: Is a directory" >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
302 exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
303 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
304 dstdir=$dst
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
305 dstbase=`basename "$src"`
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
306 case $dst in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
307 */) dst=$dst$dstbase;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
308 *) dst=$dst/$dstbase;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
309 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
310 dstdir_status=0
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
311 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
312 dstdir=`dirname "$dst"`
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
313 test -d "$dstdir"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
314 dstdir_status=$?
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
315 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
316 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
317
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
318 case $dstdir in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
319 */) dstdirslash=$dstdir;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
320 *) dstdirslash=$dstdir/;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
321 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
322
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
323 obsolete_mkdir_used=false
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
324
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
325 if test $dstdir_status != 0; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
326 case $posix_mkdir in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
327 '')
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
328 # With -d, create the new directory with the user-specified mode.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
329 # Otherwise, rely on $mkdir_umask.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
330 if test -n "$dir_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
331 mkdir_mode=-m$mode
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
332 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
333 mkdir_mode=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
334 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
335
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
336 posix_mkdir=false
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
337 # The $RANDOM variable is not portable (e.g., dash). Use it
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
338 # here however when possible just to lower collision chance.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
339 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
340
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
341 trap '
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
342 ret=$?
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
343 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
344 exit $ret
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
345 ' 0
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
346
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
347 # Because "mkdir -p" follows existing symlinks and we likely work
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
348 # directly in world-writeable /tmp, make sure that the '$tmpdir'
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
349 # directory is successfully created first before we actually test
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
350 # 'mkdir -p'.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
351 if (umask $mkdir_umask &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
352 $mkdirprog $mkdir_mode "$tmpdir" &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
353 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
354 then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
355 if test -z "$dir_arg" || {
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
356 # Check for POSIX incompatibilities with -m.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
357 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
358 # other-writable bit of parent directory when it shouldn't.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
359 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
360 test_tmpdir="$tmpdir/a"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
361 ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
362 case $ls_ld_tmpdir in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
363 d????-?r-*) different_mode=700;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
364 d????-?--*) different_mode=755;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
365 *) false;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
366 esac &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
367 $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
368 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
369 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
370 }
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
371 }
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
372 then posix_mkdir=:
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
373 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
374 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
375 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
376 # Remove any dirs left behind by ancient mkdir implementations.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
377 rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
378 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
379 trap '' 0;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
380 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
381
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
382 if
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
383 $posix_mkdir && (
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
384 umask $mkdir_umask &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
385 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
386 )
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
387 then :
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
388 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
389
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
390 # mkdir does not conform to POSIX,
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
391 # or it failed possibly due to a race condition. Create the
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
392 # directory the slow way, step by step, checking for races as we go.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
393
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
394 case $dstdir in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
395 /*) prefix='/';;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
396 [-=\(\)!]*) prefix='./';;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
397 *) prefix='';;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
398 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
399
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
400 oIFS=$IFS
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
401 IFS=/
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
402 set -f
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
403 set fnord $dstdir
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
404 shift
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
405 set +f
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
406 IFS=$oIFS
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
407
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
408 prefixes=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
409
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
410 for d
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
411 do
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
412 test X"$d" = X && continue
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
413
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
414 prefix=$prefix$d
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
415 if test -d "$prefix"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
416 prefixes=
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
417 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
418 if $posix_mkdir; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
419 (umask $mkdir_umask &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
420 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
421 # Don't fail if two instances are running concurrently.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
422 test -d "$prefix" || exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
423 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
424 case $prefix in
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
425 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
426 *) qprefix=$prefix;;
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
427 esac
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
428 prefixes="$prefixes '$qprefix'"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
429 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
430 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
431 prefix=$prefix/
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
432 done
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
433
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
434 if test -n "$prefixes"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
435 # Don't fail if two instances are running concurrently.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
436 (umask $mkdir_umask &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
437 eval "\$doit_exec \$mkdirprog $prefixes") ||
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
438 test -d "$dstdir" || exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
439 obsolete_mkdir_used=true
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
440 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
441 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
442 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
443
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
444 if test -n "$dir_arg"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
445 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
446 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
447 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
448 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
449 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
450
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
451 # Make a couple of temp file names in the proper directory.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
452 dsttmp=${dstdirslash}_inst.$$_
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
453 rmtmp=${dstdirslash}_rm.$$_
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
454
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
455 # Trap to clean up those temp files at exit.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
456 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
457
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
458 # Copy the file name to the temp name.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
459 (umask $cp_umask &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
460 { test -z "$stripcmd" || {
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
461 # Create $dsttmp read-write so that cp doesn't create it read-only,
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
462 # which would cause strip to fail.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
463 if test -z "$doit"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
464 : >"$dsttmp" # No need to fork-exec 'touch'.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
465 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
466 $doit touch "$dsttmp"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
467 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
468 }
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
469 } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
470 $doit_exec $cpprog "$src" "$dsttmp") &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
471
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
472 # and set any options; do chmod last to preserve setuid bits.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
473 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
474 # If any of these fail, we abort the whole thing. If we want to
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
475 # ignore errors from any of these, just make sure not to ignore
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
476 # errors from the above "$doit $cpprog $src $dsttmp" command.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
477 #
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
478 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
479 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
480 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
481 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
482
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
483 # If -C, don't bother to copy if it wouldn't change the file.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
484 if $copy_on_change &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
485 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
486 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
487 set -f &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
488 set X $old && old=:$2:$4:$5:$6 &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
489 set X $new && new=:$2:$4:$5:$6 &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
490 set +f &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
491 test "$old" = "$new" &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
492 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
493 then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
494 rm -f "$dsttmp"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
495 else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
496 # If $backupsuffix is set, and the file being installed
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
497 # already exists, attempt a backup. Don't worry if it fails,
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
498 # e.g., if mv doesn't support -f.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
499 if test -n "$backupsuffix" && test -f "$dst"; then
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
500 $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
501 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
502
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
503 # Rename the file to the real destination.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
504 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
505
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
506 # The rename failed, perhaps because mv can't rename something else
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
507 # to itself, or perhaps because mv is so ancient that it does not
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
508 # support -f.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
509 {
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
510 # Now remove or move aside any old file at destination location.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
511 # We try this two ways since rm can't unlink itself on some
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
512 # systems and the destination file might be busy for other
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
513 # reasons. In this case, the final cleanup might fail but the new
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
514 # file should still install successfully.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
515 {
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
516 test ! -f "$dst" ||
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
517 $doit $rmcmd "$dst" 2>/dev/null ||
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
518 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
519 { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
520 } ||
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
521 { echo "$0: cannot unlink or rename $dst" >&2
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
522 (exit 1); exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
523 }
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
524 } &&
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
525
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
526 # Now rename the file to the real destination.
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
527 $doit $mvcmd "$dsttmp" "$dst"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
528 }
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
529 fi || exit 1
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
530
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
531 trap '' 0
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
532 fi
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
533 done
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
534
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
535 # Local variables:
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
536 # eval: (add-hook 'before-save-hook 'time-stamp)
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
537 # time-stamp-start: "scriptversion="
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
538 # time-stamp-format: "%:y-%02m-%02d.%02H"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
539 # time-stamp-time-zone: "UTC0"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
540 # time-stamp-end: "; # UTC"
83c17a84bc27 Update the configure scripts with the latest autotools.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
541 # End: