Implement the -l option using ln(1) to facilitate boostrapping.
Ignore the new options -D, -h, -T, and -U. Adjust -M support to ignore an argument. Sponsored by: DARPA, AFRL Reviewed by: ian, ray, rpaulo
This commit is contained in:
parent
ffce2a5b46
commit
aaea79704b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245751
@ -30,12 +30,22 @@
|
|||||||
|
|
||||||
# parse install's options and ignore them completely.
|
# parse install's options and ignore them completely.
|
||||||
dirmode=""
|
dirmode=""
|
||||||
|
linkmode=""
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-d) dirmode="YES"; shift;;
|
-d) dirmode="YES"; shift;;
|
||||||
-[bCcMpSsv]) shift;;
|
-[bCcpSsv]) shift;;
|
||||||
-[Bfgmo]) shift; shift;;
|
-[BDfghMmNoTU]) shift; shift;;
|
||||||
-[Bfgmo]*) shift;;
|
-[BDfghMmNoTU]*) shift;;
|
||||||
|
-l)
|
||||||
|
shift
|
||||||
|
case $1 in
|
||||||
|
*[sm]*) linkmode="symbolic";; # XXX: 'm' should prefer hard
|
||||||
|
*h*) linkmode="hard";;
|
||||||
|
*) echo "invalid link mode"; exit 1;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*) break;
|
*) break;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -51,7 +61,13 @@ if [ -z "$dirmode" ] && [ "$#" -lt 2 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# the remaining arguments are assumed to be files/dirs only.
|
# the remaining arguments are assumed to be files/dirs only.
|
||||||
if [ -z "$dirmode" ]; then
|
if [ -n "${linkmode}" ]; then
|
||||||
|
if [ "${linkmode}" == "symbolic" ]; then
|
||||||
|
ln -fsh "$@"
|
||||||
|
else
|
||||||
|
ln -f "$@"
|
||||||
|
fi
|
||||||
|
elif [ -z "$dirmode" ]; then
|
||||||
exec install -p "$@"
|
exec install -p "$@"
|
||||||
else
|
else
|
||||||
exec install -d "$@"
|
exec install -d "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user