1 |
#!/bin/sh |
#!/bin/sh |
2 |
# install - install a program, script, or datafile |
# install - install a program, script, or datafile |
3 |
|
|
4 |
scriptversion=2003-06-13.21 |
scriptversion=2003-09-24.23 |
5 |
|
|
6 |
# This originates from X11R5 (mit/util/scripts/install.sh), which was |
# This originates from X11R5 (mit/util/scripts/install.sh), which was |
7 |
# later released in X11R6 (xc/config/util/install.sh) with the |
# later released in X11R6 (xc/config/util/install.sh) with the |
151 |
exit 1 |
exit 1 |
152 |
fi |
fi |
153 |
|
|
154 |
|
# Protect names starting with `-'. |
155 |
|
case $src in |
156 |
|
-*) src=./$src ;; |
157 |
|
esac |
158 |
|
|
159 |
if test -n "$dir_arg"; then |
if test -n "$dir_arg"; then |
160 |
dst=$src |
dst=$src |
161 |
src= |
src= |
180 |
exit 1 |
exit 1 |
181 |
fi |
fi |
182 |
|
|
183 |
|
# Protect names starting with `-'. |
184 |
|
case $dst in |
185 |
|
-*) dst=./$dst ;; |
186 |
|
esac |
187 |
|
|
188 |
# If destination is a directory, append the input filename; won't work |
# If destination is a directory, append the input filename; won't work |
189 |
# if double slashes aren't ignored. |
# if double slashes aren't ignored. |
190 |
if test -d "$dst"; then |
if test -d "$dst"; then |
192 |
fi |
fi |
193 |
fi |
fi |
194 |
|
|
195 |
## this sed command emulates the dirname command |
# This sed command emulates the dirname command. |
196 |
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` |
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` |
197 |
|
|
198 |
# Make sure that the destination directory exists. |
# Make sure that the destination directory exists. |
|
# (this part is taken from Noah Friedman's mkinstalldirs script.) |
|
199 |
|
|
200 |
# Skip lots of stat calls in the usual case. |
# Skip lots of stat calls in the usual case. |
201 |
if test ! -d "$dstdir"; then |
if test ! -d "$dstdir"; then |