OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 # install - install a program, script, or datafile | 2 # install - install a program, script, or datafile |
3 | 3 |
4 scriptversion=2009-04-28.21; # UTC | 4 scriptversion=2011-04-20.01; # UTC |
5 | 5 |
6 # This originates from X11R5 (mit/util/scripts/install.sh), which was | 6 # This originates from X11R5 (mit/util/scripts/install.sh), which was |
7 # later released in X11R6 (xc/config/util/install.sh) with the | 7 # later released in X11R6 (xc/config/util/install.sh) with the |
8 # following copyright and license. | 8 # following copyright and license. |
9 # | 9 # |
10 # Copyright (C) 1994 X Consortium | 10 # Copyright (C) 1994 X Consortium |
11 # | 11 # |
12 # Permission is hereby granted, free of charge, to any person obtaining a copy | 12 # Permission is hereby granted, free of charge, to any person obtaining a copy |
13 # of this software and associated documentation files (the "Software"), to | 13 # of this software and associated documentation files (the "Software"), to |
14 # deal in the Software without restriction, including without limitation the | 14 # deal in the Software without restriction, including without limitation the |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 --help display this help and exit. | 113 --help display this help and exit. |
114 --version display version info and exit. | 114 --version display version info and exit. |
115 | 115 |
116 -c (ignored) | 116 -c (ignored) |
117 -C install only if different (preserve the last data modification t
ime) | 117 -C install only if different (preserve the last data modification t
ime) |
118 -d create directories instead of installing files. | 118 -d create directories instead of installing files. |
119 -g GROUP $chgrpprog installed files to GROUP. | 119 -g GROUP $chgrpprog installed files to GROUP. |
120 -m MODE $chmodprog installed files to MODE. | 120 -m MODE $chmodprog installed files to MODE. |
121 -o USER $chownprog installed files to USER. | 121 -o USER $chownprog installed files to USER. |
122 -s $stripprog installed files. | 122 -s $stripprog installed files. |
| 123 -S $stripprog installed files. |
123 -t DIRECTORY install into DIRECTORY. | 124 -t DIRECTORY install into DIRECTORY. |
124 -T report an error if DSTFILE is a directory. | 125 -T report an error if DSTFILE is a directory. |
125 | 126 |
126 Environment variables override the default commands: | 127 Environment variables override the default commands: |
127 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG | 128 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG |
128 RMPROG STRIPPROG | 129 RMPROG STRIPPROG |
129 " | 130 " |
130 | 131 |
131 while test $# -ne 0; do | 132 while test $# -ne 0; do |
132 case $1 in | 133 case $1 in |
(...skipping 15 matching lines...) Expand all Loading... |
148 echo "$0: invalid mode: $mode" >&2 | 149 echo "$0: invalid mode: $mode" >&2 |
149 exit 1;; | 150 exit 1;; |
150 esac | 151 esac |
151 shift;; | 152 shift;; |
152 | 153 |
153 -o) chowncmd="$chownprog $2" | 154 -o) chowncmd="$chownprog $2" |
154 shift;; | 155 shift;; |
155 | 156 |
156 -s) stripcmd=$stripprog;; | 157 -s) stripcmd=$stripprog;; |
157 | 158 |
| 159 -S) stripcmd="$stripprog $2" |
| 160 shift;; |
| 161 |
158 -t) dst_arg=$2 | 162 -t) dst_arg=$2 |
159 shift;; | 163 shift;; |
160 | 164 |
161 -T) no_target_directory=true;; | 165 -T) no_target_directory=true;; |
162 | 166 |
163 --version) echo "$0 $scriptversion"; exit $?;; | 167 --version) echo "$0 $scriptversion"; exit $?;; |
164 | 168 |
165 --) shift | 169 --) shift |
166 break;; | 170 break;; |
167 | 171 |
(...skipping 25 matching lines...) Expand all Loading... |
193 if test -z "$dir_arg"; then | 197 if test -z "$dir_arg"; then |
194 echo "$0: no input file specified." >&2 | 198 echo "$0: no input file specified." >&2 |
195 exit 1 | 199 exit 1 |
196 fi | 200 fi |
197 # It's OK to call `install-sh -d' without argument. | 201 # It's OK to call `install-sh -d' without argument. |
198 # This can happen when creating conditional directories. | 202 # This can happen when creating conditional directories. |
199 exit 0 | 203 exit 0 |
200 fi | 204 fi |
201 | 205 |
202 if test -z "$dir_arg"; then | 206 if test -z "$dir_arg"; then |
203 trap '(exit $?); exit' 1 2 13 15 | 207 do_exit='(exit $ret); exit $ret' |
| 208 trap "ret=129; $do_exit" 1 |
| 209 trap "ret=130; $do_exit" 2 |
| 210 trap "ret=141; $do_exit" 13 |
| 211 trap "ret=143; $do_exit" 15 |
204 | 212 |
205 # Set umask so as not to create temps with too-generous modes. | 213 # Set umask so as not to create temps with too-generous modes. |
206 # However, 'strip' requires both read and write access to temps. | 214 # However, 'strip' requires both read and write access to temps. |
207 case $mode in | 215 case $mode in |
208 # Optimize common cases. | 216 # Optimize common cases. |
209 *644) cp_umask=133;; | 217 *644) cp_umask=133;; |
210 *755) cp_umask=22;; | 218 *755) cp_umask=22;; |
211 | 219 |
212 *[0-7]) | 220 *[0-7]) |
213 if test -z "$stripcmd"; then | 221 if test -z "$stripcmd"; then |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 fi | 519 fi |
512 done | 520 done |
513 | 521 |
514 # Local variables: | 522 # Local variables: |
515 # eval: (add-hook 'write-file-hooks 'time-stamp) | 523 # eval: (add-hook 'write-file-hooks 'time-stamp) |
516 # time-stamp-start: "scriptversion=" | 524 # time-stamp-start: "scriptversion=" |
517 # time-stamp-format: "%:y-%02m-%02d.%02H" | 525 # time-stamp-format: "%:y-%02m-%02d.%02H" |
518 # time-stamp-time-zone: "UTC" | 526 # time-stamp-time-zone: "UTC" |
519 # time-stamp-end: "; # UTC" | 527 # time-stamp-end: "; # UTC" |
520 # End: | 528 # End: |
OLD | NEW |