>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:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to