OSSP CVS Repository

ossp - Difference in ossp-pkg/shtool/sh.install versions 1.24 and 1.25
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/shtool/sh.install 1.24 -> 1.25

--- sh.install   2001/12/31 15:06:04     1.24
+++ sh.install   2002/11/02 12:46:19     1.25
@@ -20,12 +20,13 @@
 ##
 
 str_tool="install"
-str_usage="[-v|--verbose] [-t|--trace] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] [-e|--exec <sed-cmd>] <file> [<file> ...] <path>"
-arg_spec="2+"
-opt_spec="v.t.c.C.s.m:o:g:e+"
-opt_alias="v:verbose,t:trace,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec"
+str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] [-e|--exec <sed-cmd>] <file> [<file> ...] <path>"
+arg_spec="1+"
+opt_spec="v.t.d.c.C.s.m:o:g:e+"
+opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec"
 opt_v=no
 opt_t=no
+opt_d=no
 opt_c=no
 opt_C=no
 opt_s=no
@@ -36,6 +37,28 @@
 
 . ./sh.common
 
+#   special case: "shtool install -d <dir> [...]" internally
+#   maps to "shtool mkdir -f -p -m 755 <dir> [...]"
+if [ "$opt_d" = yes ]; then
+    cmd="$0 mkdir -f -p -m 755"
+    if [ ".$opt_o" != . ]; then
+        cmd="$cmd -o '$opt_o'"
+    fi
+    if [ ".$opt_g" != . ]; then
+        cmd="$cmd -g '$opt_g'"
+    fi
+    if [ ".$opt_v" = .yes ]; then
+        cmd="$cmd -v"
+    fi
+    if [ ".$opt_t" = .yes ]; then
+        cmd="$cmd -t"
+    fi
+    for dir in "$@"; do
+        eval "$cmd $dir" || exit $?
+    done
+    exit 0
+fi
+
 #   determine source(s) and destination
 argc=$#
 srcs=""

CVSTrac 2.0.1