summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2013-03-15 15:21:34 +0000
committerBrooks Davis <brooks@FreeBSD.org>2013-03-15 15:21:34 +0000
commita7fcae7c2338ead8c032aa235f79ce4862945490 (patch)
treed7826c81207f9e5e6c282b91b02d8f6f084b7df3 /tools
parent831adc1b0e306357f0fab904251c250e2da317af (diff)
Notes
Diffstat (limited to 'tools')
-rw-r--r--tools/install.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/tools/install.sh b/tools/install.sh
index 489424f93162..c28bd89ef50e 100644
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -30,12 +30,22 @@
# parse install's options and ignore them completely.
dirmode=""
+linkmode=""
while [ $# -gt 0 ]; do
case $1 in
-d) dirmode="YES"; shift;;
- -[bCcMpSsv]) shift;;
- -[Bfgmo]) shift; shift;;
- -[Bfgmo]*) shift;;
+ -[bCcpSsv]) shift;;
+ -[BDfghMmNoTU]) shift; 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;
esac
done
@@ -51,7 +61,13 @@ if [ -z "$dirmode" ] && [ "$#" -lt 2 ]; then
fi
# 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 "$@"
else
exec install -d "$@"