[PC-BSD Commits] r516 - pcbsd/trunk/system-overlay/PCBSD/Scripts/Context

svn at pcbsd.org svn at pcbsd.org
Tue Jul 17 13:49:12 PDT 2007


Author: kris
Date: 2007-07-17 21:49:12 +0100 (Tue, 17 Jul 2007)
New Revision: 516

Modified:
   pcbsd/trunk/system-overlay/PCBSD/Scripts/Context/compress.sh
Log:

Fix for right-click ZIP support, won't copy entire dir structure now



Modified: pcbsd/trunk/system-overlay/PCBSD/Scripts/Context/compress.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Scripts/Context/compress.sh	2007-07-17 20:39:06 UTC (rev 515)
+++ pcbsd/trunk/system-overlay/PCBSD/Scripts/Context/compress.sh	2007-07-17 20:49:12 UTC (rev 516)
@@ -19,10 +19,29 @@
 
 if [ "${1}" = "zip" ]
 then
-  cd "${2}"
-  zip "${3}.zip" "${3}"
+
+  i="2"
+  # Get the file
+  while
+  j=1
+  do
+   TEST="`echo ${3} | cut -d '/' -f ${i}`"
+   if [ "$TEST" = "" ]
+   then
+    i="`expr ${i} - 1`"
+    FILE="`echo ${3} | cut -d '/' -f ${i}`"
+    break
+   fi
+
+   i="`expr ${i} + 1`"
+  done
+
+  # Cd over and compress the file
+  cd ${2}
+  zip "${FILE}.zip" "${FILE}"
 fi
 
+
 if [ "${1}" = "tgz" ]
 then
  



More information about the Commits mailing list