Permalink
Browse files

bin/install: implement -D internally

Signed-off-by: Chris Larson <chris_larson@mentor.com>
  • Loading branch information...
1 parent d066be7 commit c24d7b911fbbd11faa2958fcfc12b5a8d1742ee5 @kergoth kergoth committed Nov 15, 2010
Showing with 12 additions and 1 deletion.
  1. +12 −1 bin/install
View
@@ -1,9 +1,13 @@
#!/bin/sh
+#
+# Portability notes:
+# - We allow what SuSv3 defines
+# - We implement -D internally
source $(dirname $0)/wrapper.sh
saved=""
-while getopts dbCcMpSsvB:f:g:m:o: opt; do
+while getopts dbCcMpSsvB:f:g:m:o:D opt; do
case "$opt" in
s)
# Ignore strip argument
@@ -12,6 +16,9 @@ while getopts dbCcMpSsvB:f:g:m:o: opt; do
save "-$opt"
save "$OPTARG"
;;
+ D)
+ createleading="1"
+ ;;
\?)
exit 1
;;
@@ -25,4 +32,8 @@ for arg; do
save "$arg"
done
+if [ $# == 2 -a -n "$createleading" ]; then
+ install -d $(dirname $2)
+fi
+
exec_real

0 comments on commit c24d7b9

Please sign in to comment.