diff options
author | uqs <uqs@FreeBSD.org> | 2011-02-22 08:07:17 +0000 |
---|---|---|
committer | uqs <uqs@FreeBSD.org> | 2011-02-22 08:07:17 +0000 |
commit | 39bd167d328aba193d4774d21ec95b107419b186 (patch) | |
tree | cb3241abb4241b8fb1a673b6dd5b1aa41dc73347 /tools | |
parent | 33cfbb02c4e93874e1572097a3acc46e3dfb6ec9 (diff) | |
download | FreeBSD-src-39bd167d328aba193d4774d21ec95b107419b186.zip FreeBSD-src-39bd167d328aba193d4774d21ec95b107419b186.tar.gz |
Teach tools/install.sh the -d directory mode.
Sync up with flags understood by install(1) [1], and make install(1)'s
usage output not hide the clearly documented -M flag.
PR: misc/154739 [1]
Submitted by: arundel
Diffstat (limited to 'tools')
-rw-r--r-- | tools/install.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/install.sh b/tools/install.sh index 594d4de..489424f 100644 --- a/tools/install.sh +++ b/tools/install.sh @@ -29,14 +29,30 @@ # $FreeBSD$ # parse install's options and ignore them completely. +dirmode="" while [ $# -gt 0 ]; do case $1 in - -[bCcMpSs]) shift;; + -d) dirmode="YES"; shift;; + -[bCcMpSsv]) shift;; -[Bfgmo]) shift; shift;; -[Bfgmo]*) shift;; *) break; esac done +if [ "$#" -eq 0 ]; then + echo "$0: no files/dirs specified" >&2 + exit 1 +fi + +if [ -z "$dirmode" ] && [ "$#" -lt 2 ]; then + echo "$0: no target specified" >&2 + exit 1 +fi + # the remaining arguments are assumed to be files/dirs only. -exec install -p $* +if [ -z "$dirmode" ]; then + exec install -p "$@" +else + exec install -d "$@" +fi |