[58020] trunk/base/src/port1.0/portpatch.tcl

afb at macports.org afb at macports.org
Sun Sep 20 13:33:49 PDT 2009


Revision: 58020
          http://trac.macports.org/changeset/58020
Author:   afb at macports.org
Date:     2009-09-20 13:33:48 -0700 (Sun, 20 Sep 2009)
Log Message:
-----------
add patch.type=gnu, for ports that just gotta have gnu patch

Modified Paths:
--------------
    trunk/base/src/port1.0/portpatch.tcl

Modified: trunk/base/src/port1.0/portpatch.tcl
===================================================================
--- trunk/base/src/port1.0/portpatch.tcl	2009-09-20 20:27:45 UTC (rev 58019)
+++ trunk/base/src/port1.0/portpatch.tcl	2009-09-20 20:33:48 UTC (rev 58020)
@@ -49,9 +49,24 @@
 # Set up defaults
 default patch.asroot no
 default patch.dir {${worksrcpath}}
-default patch.cmd {[findBinary patch $portutil::autoconf::patch_path]}
+default patch.cmd {[portpatch::build_getpatchtype]}
 default patch.pre_args -p0
 
+proc portpatch::build_getpatchtype {args} {
+    if {![exists patch.type]} {
+        return [findBinary patch $portutil::autoconf::patch_path]
+    }
+    switch -exact -- [option patch.type] {
+        gnu {
+            return [findBinary gpatch $portutil::autoconf::gnupatch_path]
+        }
+        default {
+            ui_warn "[format [msgcat::mc "Unknown patch.type %s, using 'patch'"] [option patch.type]]"
+            return [findBinary patch $portutil::autoconf::patch_path]
+        }
+    }
+}
+
 proc portpatch::patch_main {args} {
     global UI_PREFIX
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090920/bb7e92ad/attachment.html>


More information about the macports-changes mailing list