From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 13 14:50:08 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63F641065679 for ; Sun, 13 Feb 2011 14:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 259468FC15 for ; Sun, 13 Feb 2011 14:50:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p1DEo82a019256 for ; Sun, 13 Feb 2011 14:50:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p1DEo7LL019255; Sun, 13 Feb 2011 14:50:08 GMT (envelope-from gnats) Resent-Date: Sun, 13 Feb 2011 14:50:08 GMT Resent-Message-Id: <201102131450.p1DEo7LL019255@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexander Best Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE572106566C for ; Sun, 13 Feb 2011 14:45:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id CC8B68FC08 for ; Sun, 13 Feb 2011 14:45:07 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p1DEj7qG048668 for ; Sun, 13 Feb 2011 14:45:07 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p1DEj7gm048667; Sun, 13 Feb 2011 14:45:07 GMT (envelope-from nobody) Message-Id: <201102131445.p1DEj7gm048667@red.freebsd.org> Date: Sun, 13 Feb 2011 14:45:07 GMT From: Alexander Best To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/154739: [patch] install.sh doesn't ignore the -v flag and doesn't honour the -d switch X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2011 14:50:08 -0000 >Number: 154739 >Category: misc >Synopsis: [patch] install.sh doesn't ignore the -v flag and doesn't honour the -d switch >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Feb 13 14:50:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Alexander Best >Release: 9.0-CURRENT >Organization: >Environment: FreeBSD otaku 9.0-CURRENT FreeBSD 9.0-CURRENT #1 r218613M: Sat Feb 12 18:49:57 CET 2011 arundel@otaku:/usr/obj/usr/subversion-src/sys/ARUNDEL amd64 >Description: as discussed in [1], this patch will a) fix install.sh in order to also ignore the -v switch and b) will allow install.sh to switch to a directory creation mode via the -d flag. please note that this patch is the work of Eygene Ryabinkin with a few minor tweaks by myself. cheers. alex [1] http://docs.freebsd.org/cgi/mid.cgi?20110203194306.GA55376 >How-To-Repeat: See [1]. >Fix: Patch attached with submission follows: Index: tools/install.sh =================================================================== --- tools/install.sh (revision 218217) +++ tools/install.sh (working copy) @@ -29,14 +29,25 @@ # $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 "Nothing to do: no files/dirs 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 >Release-Note: >Audit-Trail: >Unformatted: