[darwinbuild-changes] [158] trunk/darwinbuild/darwinbuild

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 4 01:52:42 PDT 2006


Revision: 158
          http://trac.macosforge.org/projects/darwinbuild/changeset/158
Author:   ssen
Date:     2006-10-04 01:52:41 -0700 (Wed, 04 Oct 2006)

Log Message:
-----------
First, detect whether a patchfile uses gzip, bzip2, or no
compression. Then based on the filename, apply the patch
with either -p1 or -p0

Modified Paths:
--------------
    trunk/darwinbuild/darwinbuild

Modified: trunk/darwinbuild/darwinbuild
===================================================================
--- trunk/darwinbuild/darwinbuild	2005-08-07 22:46:10 UTC (rev 157)
+++ trunk/darwinbuild/darwinbuild	2006-10-04 08:52:41 UTC (rev 158)
@@ -445,14 +445,26 @@
 for patchfile in $patchfilenames; do
 	echo "*** Applying Patch $patchfile ..."
 	if [ -r "$SourceCache/$patchfile" ]; then
+	    catprog=""
 	    case $patchfile in
-		*.patch)
-		    cat "$SourceCache/$patchfile" | patch --posix -l -p0
+		*.gz)
+		    catprog="gzip -d -c"
 		    ;;
-		*.patch.gz)
-		    gzip -c -d "$SourceCache/$patchfile" | patch --posix -l -p0
+		*.bz2)
+		    catprog="bzip2 -d -c"
 		    ;;
 		*)
+		    catprog="cat"
+		    ;;
+	    esac
+	    case $patchfile in
+		*.p1.patch*)
+		    $catprog "$SourceCache/$patchfile" | patch --posix -l -p1
+		    ;;
+		*.patch*)
+		    $catprog "$SourceCache/$patchfile" | patch --posix -l -p0
+		    ;;
+		*)
 		    echo "Don't know how to apply $patchfile"
 		    ;;
 	    esac

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/5701eb0f/attachment.html


More information about the darwinbuild-changes mailing list