OSSP CVS Repository

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

Check-in Number: 5937
Date: 2007-May-15 21:35:48 (local)
2007-May-15 19:35:48 (UTC)
User:rse
Branch:
Comment: 1. Fix "shtool mkln" by fixing the determination whether relative source paths can be used or not. 2. Make "shtool install" more robust by quoting arguments.
Tickets:
Inspections:
Files:
ossp-pkg/shtool/ChangeLog      1.230 -> 1.231     7 inserted, 0 deleted
ossp-pkg/shtool/sh.install      1.33 -> 1.34     4 inserted, 4 deleted
ossp-pkg/shtool/sh.mkln      1.20 -> 1.21     11 inserted, 6 deleted

ossp-pkg/shtool/ChangeLog 1.230 -> 1.231

--- ChangeLog    2006/09/29 06:36:31     1.230
+++ ChangeLog    2007/05/15 19:35:48     1.231
@@ -11,6 +11,13 @@
 
  Changes between 2.0.6 and 2.0.7 (19-Apr-2006 to xx-Sep-2006):
 
+   *) Fix "shtool mkln" by fixing the determination whether
+      relative source paths can be used or not.
+      [Ralf S. Engelschall]
+
+   *) Make "shtool install" more robust by quoting arguments.
+      [Ralf S. Engelschall]
+
    *) Fix and enhance "shtool echo -e" command by adding a missing
       line-continuation and adding support for MacOS X via nidump(8)
       and NIS+ support via niscat(8) and nismatch(8).


ossp-pkg/shtool/sh.install 1.33 -> 1.34

--- sh.install   2006/02/04 09:43:25     1.33
+++ sh.install   2007/05/15 19:35:48     1.34
@@ -119,12 +119,12 @@
         if [ ".$opt_t" = .yes ]; then
             echo "cp $src $dsttmp" 1>&2
         fi
-        cp $src $dsttmp || shtool_exit $?
+        cp "$src" "$dsttmp" || shtool_exit $?
     else
         if [ ".$opt_t" = .yes ]; then
             echo "mv $src $dsttmp" 1>&2
         fi
-        mv $src $dsttmp || shtool_exit $?
+        mv "$src" "$dsttmp" || shtool_exit $?
     fi
 
     #   adjust the target file
@@ -135,7 +135,7 @@
         do
             sed="$sed -e '$e'"
         done
-        cp $dsttmp $dsttmp.old
+        cp "$dsttmp" "$dsttmp.old"
         chmod u+w $dsttmp
         eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $?
         rm -f $dsttmp.old
@@ -170,7 +170,7 @@
     quick=no
     if [ ".$opt_C" = .yes ]; then
         if [ -r $dst ]; then
-            if cmp -s $src $dst; then
+            if cmp -s "$src" "$dst"; then
                 quick=yes
             fi
         fi


ossp-pkg/shtool/sh.mkln 1.20 -> 1.21

--- sh.mkln      2006/02/04 09:43:25     1.20
+++ sh.mkln      2007/05/15 19:35:48     1.21
@@ -131,12 +131,17 @@
     #   determine source prefix which is the reverse directory
     #   step-up corresponding to the destination directory
     srcpre=""
-
-    isroot=0
-    if [ ".$prefix" = . ] || [ ".$prefix" = ./ ]; then
-        isroot=1
-    fi
-    if [ $oneisabs = 0 ] || [ $isroot = 0 ]; then
+    allow_relative_srcpre=no
+    if [ ".$prefix" != . ] && [ ".$prefix" != ./ ]; then
+        allow_relative_srcpre=yes
+    fi  
+    if [ $oneisabs = 0 ]; then
+        allow_relative_srcpre=yes
+    fi  
+    if [ ".$opt_s" != .yes ]; then
+        allow_relative_srcpre=no
+    fi  
+    if [ ".$allow_relative_srcpre" = .yes ]; then
         pl="$dstdir/"
         OIFS="$IFS"; IFS='/'
         for pe in $pl; do

CVSTrac 2.0.1