OSSP CVS Repository

ossp - Check-in [2712]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2712
Date: 2002-Nov-02 13:46:19 (local)
2002-Nov-02 12:46:19 (UTC)
User:rse
Branch:
Comment: Map "shtool install -d <dir> [...]" internally to "shtool mkdir -f -p -m 755 <dir> [...]" in order to support the BSD-style "install -d" variant.

Idea (and initial patch) submitted by: Alan Eldridge <alane@geeksrus.net>

Tickets:
Inspections:
Files:
ossp-pkg/shtool/ChangeLog      1.174 -> 1.175     5 inserted, 0 deleted
ossp-pkg/shtool/sh.install      1.24 -> 1.25     27 inserted, 4 deleted
ossp-pkg/shtool/shtool.pod      1.60 -> 1.61     4 inserted, 2 deleted

ossp-pkg/shtool/ChangeLog 1.174 -> 1.175

--- ChangeLog    2002/11/02 12:35:56     1.174
+++ ChangeLog    2002/11/02 12:46:19     1.175
@@ -11,6 +11,11 @@
 
  Changes between 1.6.1 and 1.6.2 (12-Jul-2002 to xx-Oct-2002):
 
+   *) Map "shtool install -d <dir> [...]" internally to "shtool mkdir
+      -f -p -m 755 <dir> [...]" in order to support the BSD-style
+      "install -d" variant.
+      [Ralf S. Engelschall, Alan Eldridge <alane@geeksrus.net>]
+
    *) Add -o|--owner and -g|--group options to "shtool mkdir".
       [Ralf S. Engelschall]
 


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=""


ossp-pkg/shtool/shtool.pod 1.60 -> 1.61

--- shtool.pod   2002/11/02 12:35:56     1.60
+++ shtool.pod   2002/11/02 12:46:19     1.61
@@ -414,7 +414,7 @@
      lex scanner.l
      shtool move -t -p lex.yy.c scanner.c
 
-=item B<install> [B<-v>|B<--verbose>] [B<-t>|B<--trace>] [B<-c>|B<--copy>] [B<-C>|B<--compare-copy>] [B<-s>|B<--strip>] [B<-m>|B<--mode> I<mode>] [B<-o>|B<--owner> I<owner>] [B<-g>|B<--group> I<group>] [B<-e>|B<--exec> I<sed-cmd>] I<file> I<path>
+=item B<install> [B<-v>|B<--verbose>] [B<-t>|B<--trace>] [B<-c>|B<--copy>] [B<-C>|B<--compare-copy>] [B<-s>|B<--strip>] [B<-m>|B<--mode> I<mode>] [B<-o>|B<--owner> I<owner>] [B<-g>|B<--group> I<group>] [B<-e>|B<--exec> I<sed-cmd>] [B<-d>|B<--mkdir>] I<file> I<path>
 
 This command installs a program, script or datafile (dependent on I<mode>) in
 a portable way while providing all important options of the BSD install(1)
@@ -434,7 +434,9 @@
 the output of the essential shell commands which are executed.
 
 The trick of this command is that it provides the functionality of BSD
-install(1) in a portable emulated way.
+install(1) in a portable emulated way. For even more compatibility,
+the BSD "B<shtool> C<install -d>" usage is internally mapped to the
+"B<shtool> C<mkdir -f -p -m 755>" command.
 
 Example:
 

CVSTrac 2.0.1