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
This commit is contained in:
parent
33cfbb02c4
commit
39bd167d32
@ -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
|
||||
|
@ -769,9 +769,9 @@ static void
|
||||
usage(void)
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n"
|
||||
"usage: install [-bCcMpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n"
|
||||
" [-o owner] file1 file2\n"
|
||||
" install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n"
|
||||
" install [-bCcMpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n"
|
||||
" [-o owner] file1 ... fileN directory\n"
|
||||
" install -d [-v] [-g group] [-m mode] [-o owner] directory ...\n");
|
||||
exit(EX_USAGE);
|
||||
|
Loading…
Reference in New Issue
Block a user