From owner-svn-src-stable-8@FreeBSD.ORG Sat Jul 2 16:20:58 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8140C106566B; Sat, 2 Jul 2011 16:20:58 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 709068FC16; Sat, 2 Jul 2011 16:20:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p62GKwP3047280; Sat, 2 Jul 2011 16:20:58 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p62GKw6n047277; Sat, 2 Jul 2011 16:20:58 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201107021620.p62GKw6n047277@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 2 Jul 2011 16:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223724 - in stable/8: tools usr.bin/xinstall X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jul 2011 16:20:58 -0000 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);