Date: Sat, 2 Jul 2011 16:20:58 +0000 (UTC) From: Ulrich Spoerlein <uqs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r223724 - in stable/8: tools usr.bin/xinstall Message-ID: <201107021620.p62GKw6n047277@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: uqs Date: Sat Jul 2 16:20:58 2011 New Revision: 223724 URL: http://svn.freebsd.org/changeset/base/223724 Log: MFH r218940: 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. Modified: stable/8/tools/install.sh stable/8/usr.bin/xinstall/xinstall.c Directory Properties: stable/8/tools/ (props changed) stable/8/usr.bin/xinstall/ (props changed) Modified: stable/8/tools/install.sh ============================================================================== --- stable/8/tools/install.sh Sat Jul 2 15:41:22 2011 (r223723) +++ stable/8/tools/install.sh Sat Jul 2 16:20:58 2011 (r223724) @@ -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 Modified: stable/8/usr.bin/xinstall/xinstall.c ============================================================================== --- stable/8/usr.bin/xinstall/xinstall.c Sat Jul 2 15:41:22 2011 (r223723) +++ stable/8/usr.bin/xinstall/xinstall.c Sat Jul 2 16:20:58 2011 (r223724) @@ -774,9 +774,9 @@ void usage() { (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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107021620.p62GKw6n047277>