115 |
if [ x"$dir_arg" != x ]; then |
if [ x"$dir_arg" != x ]; then |
116 |
dst=$src |
dst=$src |
117 |
src="" |
src="" |
118 |
|
|
119 |
if [ -d $dst ]; then |
if [ -d $dst ]; then |
120 |
instcmd=: |
instcmd=: |
121 |
else |
else |
124 |
else |
else |
125 |
|
|
126 |
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command |
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command |
127 |
# might cause directories to be created, which would be especially bad |
# might cause directories to be created, which would be especially bad |
128 |
# if $src (and thus $dsttmp) contains '*'. |
# if $src (and thus $dsttmp) contains '*'. |
129 |
|
|
130 |
if [ -f $src -o -d $src ] |
if [ -f $src -o -d $src ] |
134 |
echo "install: $src does not exist" |
echo "install: $src does not exist" |
135 |
exit 1 |
exit 1 |
136 |
fi |
fi |
137 |
|
|
138 |
if [ x"$dst" = x ] |
if [ x"$dst" = x ] |
139 |
then |
then |
140 |
echo "install: no destination specified" |
echo "install: no destination specified" |
162 |
|
|
163 |
# Skip lots of stat calls in the usual case. |
# Skip lots of stat calls in the usual case. |
164 |
if [ ! -d "$dstdir" ]; then |
if [ ! -d "$dstdir" ]; then |
165 |
defaultIFS=' |
defaultIFS=' |
166 |
' |
' |
167 |
IFS="${IFS-${defaultIFS}}" |
IFS="${IFS-${defaultIFS}}" |
168 |
|
|
201 |
|
|
202 |
# If we're going to rename the final executable, determine the name now. |
# If we're going to rename the final executable, determine the name now. |
203 |
|
|
204 |
if [ x"$transformarg" = x ] |
if [ x"$transformarg" = x ] |
205 |
then |
then |
206 |
dstfile=`basename $dst` |
dstfile=`basename $dst` |
207 |
else |
else |
208 |
dstfile=`basename $dst $transformbasename | |
dstfile=`basename $dst $transformbasename | |
209 |
sed $transformarg`$transformbasename |
sed $transformarg`$transformbasename |
210 |
fi |
fi |
211 |
|
|
212 |
# don't allow the sed command to completely eliminate the filename |
# don't allow the sed command to completely eliminate the filename |
213 |
|
|
214 |
if [ x"$dstfile" = x ] |
if [ x"$dstfile" = x ] |
215 |
then |
then |
216 |
dstfile=`basename $dst` |
dstfile=`basename $dst` |
217 |
else |
else |
242 |
# Now rename the file to the real destination. |
# Now rename the file to the real destination. |
243 |
|
|
244 |
$doit $rmcmd -f $dstdir/$dstfile && |
$doit $rmcmd -f $dstdir/$dstfile && |
245 |
$doit $mvcmd $dsttmp $dstdir/$dstfile |
$doit $mvcmd $dsttmp $dstdir/$dstfile |
246 |
|
|
247 |
fi && |
fi && |
248 |
|
|