OSSP CVS Repository

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

ossp-pkg/shtool/sh.mkdir 1.18 -> 1.19

--- sh.mkdir     2001/12/31 15:06:04     1.18
+++ sh.mkdir     2002/11/02 12:35:56     1.19
@@ -21,14 +21,16 @@
 ##
 
 str_tool="mkdir"
-str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode <mode>] <dir> [<dir> ...]"
+str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] <dir> [<dir> ...]"
 arg_spec="1+"
-opt_spec="t.f.p.m:"
-opt_alias="t:trace,f:force,p:parents,m:mode"
+opt_spec="t.f.p.m:o:g:"
+opt_alias="t:trace,f:force,p:parents,m:mode,o:owner,g:group"
 opt_t=no
 opt_f=no
 opt_p=no
 opt_m=""
+opt_o=""
+opt_g=""
 
 . ./sh.common
 
@@ -50,6 +52,18 @@
             echo "mkdir $p" 1>&2
         fi
         mkdir $p || errstatus=$?
+        if [ ".$opt_o" != . ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "chown $opt_o $p" 1>&2
+            fi
+            chown $opt_o $p || errstatus=$?
+        fi
+        if [ ".$opt_g" != . ]; then
+            if [ ".$opt_t" = .yes ]; then
+                echo "chgrp $opt_g $p" 1>&2
+            fi
+            chgrp $opt_g $p || errstatus=$?
+        fi
         if [ ".$opt_m" != . ]; then
             if [ ".$opt_t" = .yes ]; then
                 echo "chmod $opt_m $p" 1>&2
@@ -75,6 +89,18 @@
                     echo "mkdir $pathcomp" 1>&2
                 fi
                 mkdir $pathcomp || errstatus=$?
+                if [ ".$opt_o" != . ]; then
+                    if [ ".$opt_t" = .yes ]; then
+                        echo "chown $opt_o $pathcomp" 1>&2
+                    fi
+                    chown $opt_o $pathcomp || errstatus=$?
+                fi
+                if [ ".$opt_g" != . ]; then
+                    if [ ".$opt_t" = .yes ]; then
+                        echo "chgrp $opt_g $pathcomp" 1>&2
+                    fi
+                    chgrp $opt_g $pathcomp || errstatus=$?
+                fi
                 if [ ".$opt_m" != . ]; then
                     if [ ".$opt_t" = .yes ]; then
                         echo "chmod $opt_m $pathcomp" 1>&2

CVSTrac 2.0.1