[Lunar-commits] CVS: theedge/var/lib/lunar/functions edit.lunar, 1.14, 1.15

Auke Kok sofar at lunar-linux.org
Tue Jul 6 20:21:13 GMT 2004


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv23336/var/lib/lunar/functions

Modified Files:
	edit.lunar 
Log Message:
Allow patches to be searched in $(PWD) && $SOURCE_CACHE, so you never have to explicitly specify the location. uniform calling as with unpack() now.


Index: edit.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/edit.lunar,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- edit.lunar	25 Feb 2004 21:39:33 -0000	1.14
+++ edit.lunar	6 Jul 2004 20:21:11 -0000	1.15
@@ -17,16 +17,23 @@
 #            of formats
 patch_it () { 
   verbose_msg "patch_it \"$1\" \"$2\"";
-  
-  if [[ -n `echo $1 | grep '\.tar'` ]] ; then
+
+  # get patch from $SOURCE_CACHE automatically
+  if [ ! -f "$1" -a -f "$SOURCE_CACHE/$1" ] ; then
+    PATCH="$SOURCE_CACHE/$1"
+  else
+    PATCH="$1"
+  fi
+
+  if [[ -n `echo $PATCH | grep '\.tar'` ]] ; then
     TARCMD="tar x -O"
   else
     TARCMD="cat"
   fi
 
-  if [[ -n `echo $1 | grep '\.bz2$'` ]] ; then
+  if [[ -n `echo $PATCH | grep '\.bz2$'` ]] ; then
     GZCMD="bzcat"
-  elif [[ -n `echo $1 | grep '\.gz$'` ]] ; then
+  elif [[ -n `echo $PATCH | grep '\.gz$'` ]] ; then
     GZCMD="zcat"
   else
     GZCMD="cat"
@@ -35,7 +42,7 @@
   TMPFILE1=$(temp_create "patch_1")
   TMPFILE2=$(temp_create "patch_2")
 
-  if $GZCMD $1 > $TMPFILE1 ; then
+  if $GZCMD $PATCH > $TMPFILE1 ; then
     # uncompress OK
     if cat $TMPFILE1 | $TARCMD > $TMPFILE2 ; then
       # untar OK
@@ -48,7 +55,7 @@
     fi
   fi
 
-  message "${PROBLEM_COLOR}! Broken patch file ${DEFAULT_COLOR}${FILE_COLOR}$1${DEFAULT_COLOR}"
+  message "${PROBLEM_COLOR}! Broken patch file ${DEFAULT_COLOR}${FILE_COLOR}$PATCH${DEFAULT_COLOR}"
 
   temp_destroy $TMPFILE1
   temp_destroy $TMPFILE2



More information about the Lunar-commits mailing list