mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
Regenerate.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# install - install a program, script, or datafile
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
scriptversion=2003-09-24.23
|
scriptversion=2004-01-12.10
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
@@ -72,7 +72,8 @@ dst=
|
|||||||
dir_arg=
|
dir_arg=
|
||||||
|
|
||||||
usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
|
usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
|
||||||
or: $0 -d DIR1 DIR2...
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
|
or: $0 -d DIRECTORIES...
|
||||||
|
|
||||||
In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
|
In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
|
||||||
In the second, create the directory path DIR.
|
In the second, create the directory path DIR.
|
||||||
@@ -134,29 +135,41 @@ while test -n "$1"; do
|
|||||||
|
|
||||||
--version) echo "$0 $scriptversion"; exit 0;;
|
--version) echo "$0 $scriptversion"; exit 0;;
|
||||||
|
|
||||||
*) if test -z "$src"; then
|
*) # When -d is used, all remaining arguments are directories to create.
|
||||||
src=$1
|
test -n "$dir_arg" && break
|
||||||
else
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
# this colon is to work around a 386BSD /bin/sh bug
|
for arg
|
||||||
:
|
do
|
||||||
dst=$1
|
if test -n "$dstarg"; then
|
||||||
|
# $@ is not empty: it contains at least $arg.
|
||||||
|
set fnord "$@" "$dstarg"
|
||||||
|
shift # fnord
|
||||||
fi
|
fi
|
||||||
shift
|
shift # arg
|
||||||
continue;;
|
dstarg=$arg
|
||||||
|
done
|
||||||
|
break;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if test -z "$src"; then
|
if test -z "$1"; then
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
echo "$0: no input file specified." >&2
|
echo "$0: no input file specified." >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
# It's OK to call `install-sh -d' without argument.
|
||||||
|
# This can happen when creating conditional directories.
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Protect names starting with `-'.
|
for src
|
||||||
case $src in
|
do
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $src in
|
||||||
-*) src=./$src ;;
|
-*) src=./$src ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
if test -n "$dir_arg"; then
|
||||||
dst=$src
|
dst=$src
|
||||||
src=
|
src=
|
||||||
|
|
||||||
@@ -166,7 +179,7 @@ if test -n "$dir_arg"; then
|
|||||||
else
|
else
|
||||||
instcmd=$mkdirprog
|
instcmd=$mkdirprog
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||||
# might cause directories to be created, which would be especially bad
|
# might cause directories to be created, which would be especially bad
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
@@ -175,11 +188,12 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dst"; then
|
if test -z "$dstarg"; then
|
||||||
echo "$0: no destination specified." >&2
|
echo "$0: no destination specified." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dst=$dstarg
|
||||||
# Protect names starting with `-'.
|
# Protect names starting with `-'.
|
||||||
case $dst in
|
case $dst in
|
||||||
-*) dst=./$dst ;;
|
-*) dst=./$dst ;;
|
||||||
@@ -190,15 +204,15 @@ else
|
|||||||
if test -d "$dst"; then
|
if test -d "$dst"; then
|
||||||
dst=$dst/`basename "$src"`
|
dst=$dst/`basename "$src"`
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# This sed command emulates the dirname command.
|
# This sed command emulates the dirname command.
|
||||||
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||||
|
|
||||||
# Make sure that the destination directory exists.
|
# Make sure that the destination directory exists.
|
||||||
|
|
||||||
# Skip lots of stat calls in the usual case.
|
# Skip lots of stat calls in the usual case.
|
||||||
if test ! -d "$dstdir"; then
|
if test ! -d "$dstdir"; then
|
||||||
defaultIFS='
|
defaultIFS='
|
||||||
'
|
'
|
||||||
IFS="${IFS-$defaultIFS}"
|
IFS="${IFS-$defaultIFS}"
|
||||||
@@ -217,16 +231,16 @@ if test ! -d "$dstdir"; then
|
|||||||
test -d "$pathcomp" || $mkdirprog "$pathcomp"
|
test -d "$pathcomp" || $mkdirprog "$pathcomp"
|
||||||
pathcomp=$pathcomp/
|
pathcomp=$pathcomp/
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
if test -n "$dir_arg"; then
|
||||||
$doit $instcmd "$dst" \
|
$doit $instcmd "$dst" \
|
||||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||||
|
|
||||||
else
|
else
|
||||||
# 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.
|
||||||
if test -z "$transformarg"; then
|
if test -z "$transformarg"; then
|
||||||
dstfile=`basename "$dst"`
|
dstfile=`basename "$dst"`
|
||||||
@@ -280,7 +294,8 @@ else
|
|||||||
|
|
||||||
# Now rename the file to the real destination.
|
# Now rename the file to the real destination.
|
||||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||||
fi &&
|
fi || { (exit 1); exit; }
|
||||||
|
done
|
||||||
|
|
||||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user