[90652] branches/release_2_0/base

cal at macports.org cal at macports.org
Sun Mar 11 14:13:48 PDT 2012


Revision: 90652
          http://trac.macports.org/changeset/90652
Author:   cal at macports.org
Date:     2012-03-11 14:13:48 -0700 (Sun, 11 Mar 2012)
Log Message:
-----------
Add automatic depends_build bin:bsdmake:bsdmake on ports setting build.type bsd

Modified Paths:
--------------
    branches/release_2_0/base/ChangeLog
    branches/release_2_0/base/src/port1.0/portbuild.tcl
    branches/release_2_0/base/src/port1.0/portdestroot.tcl

Property Changed:
----------------
    branches/release_2_0/base/


Property changes on: branches/release_2_0/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:79584,79586,79590-79594,79599-79600,79649,79686,79689,79692,79750,79762,79771-79774,79782,79787,79864,79943,80069,80088,80178,80220,80222,80224,80226,80229,80245,80248,80287,80335,80443,80581,80583,80586,80779,80797-80798,80894,80928,80932,80934,80969,80971,81005,81119,81146,81171,81234,81269,81361,81371,81414-81415,81454,81464,81467,81475,81522,81556-81558,81562,81565,81567,81577,81630,81657,81830-81832,82111,82135,82767,82921,82924,82947,83136,83149,83267,83270-83271,83391,83395,83443,83471,83537,84344-84345,84351,84908-84909,84931,84937,86131,88032,88045,88179,88185,89429,89537-89539,89612,89839,89894,89988,89993-89994,90000,90002,90004,90010,90020,90032,90054,90056,90058,90075,90082-90084,90088,90100,90107,90112,90151,90154,90180,90647
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:79584,79586,79590-79594,79599-79600,79649,79686,79689,79692,79750,79762,79771-79774,79782,79787,79864,79943,80069,80088,80178,80220,80222,80224,80226,80229,80245,80248,80287,80335,80443,80581,80583,80586,80779,80797-80798,80894,80928,80932,80934,80969,80971,81005,81119,81146,81171,81234,81269,81361,81371,81414-81415,81454,81464,81467,81475,81522,81556-81558,81562,81565,81567,81577,81630,81657,81830-81832,82111,82135,82767,82921,82924,82947,83136,83149,83267,83270-83271,83391,83395,83443,83471,83537,84344-84345,84351,84908-84909,84931,84937,86131,88032,88045,88179,88185,89429,89537-89539,89612,89839,89894,89988,89993-89994,90000,90002,90004,90010,90020,90032,90054,90056,90058,90075,90082-90084,90088,90100,90107,90112,90151,90154,90180,90647,90650-90651
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/release_2_0/base/ChangeLog
===================================================================
--- branches/release_2_0/base/ChangeLog	2012-03-11 21:10:25 UTC (rev 90651)
+++ branches/release_2_0/base/ChangeLog	2012-03-11 21:13:48 UTC (rev 90652)
@@ -4,6 +4,10 @@
 ###
 
 Unreleased changes:
+    - port automatically installs bsdmake when there's no bsdmake in $PATH and a
+      port sets build.type bsd
+      (cal in r90650)
+
     - port livecheck regex finds multiple matches on the same line
       (raimue in r88031)
 

Modified: branches/release_2_0/base/src/port1.0/portbuild.tcl
===================================================================
--- branches/release_2_0/base/src/port1.0/portbuild.tcl	2012-03-11 21:10:25 UTC (rev 90651)
+++ branches/release_2_0/base/src/port1.0/portbuild.tcl	2012-03-11 21:13:48 UTC (rev 90652)
@@ -43,9 +43,10 @@
 }
 
 # define options
+options build.asroot
+options build.jobs
 options build.target
-options build.jobs
-options build.asroot
+options build.type
 options use_parallel_build
 commands build
 # defaults
@@ -56,12 +57,38 @@
 default build.jobs {[portbuild::build_getjobs]}
 default build.pre_args {[portbuild::build_getargs]}
 default build.target "all"
+default build.type "default"
 default use_parallel_build yes
 
+# proc to add dependency on bsdmake, if necessary
+option_proc build.type portbuild::set_build_type
+
 set_ui_prefix
 
+proc portbuild::set_build_type {option action args} {
+    array set build_type_map {
+        bsd     {bin:bsdmake:bsdmake}
+    }
+
+    if {$action == "set"} {
+        switch $option {
+            build.type {
+                # using [exists foo] doesn't work with arrays!
+                if {[info exists build_type_map([option build.type])]} {
+                    # remove dependencies added before when setting build.type more than once
+                    eval depends_build-delete $build_type_map([option build.type])
+                }
+                if {[info exists build_type_map($args)]} {
+                    # add dependency if needed
+                    eval depends_build-append $build_type_map($args)
+                }
+            }
+        }
+    }
+}
+
 proc portbuild::build_getmaketype {args} {
-    if {![exists build.type]} {
+    if {[option build.type] == "default"} {
         return [findBinary make $portutil::autoconf::make_path]
     }
     switch -exact -- [option build.type] {
@@ -124,7 +151,8 @@
 }
 
 proc portbuild::build_getargs {args} {
-    if {((![exists build.type] && [option os.platform] != "freebsd") || ([exists build.type] && [option build.type] == "gnu")) \
+    if {(([option build.type] == "default" && [option os.platform] != "freebsd") || \
+         ([option build.type] == "gnu")) \
         && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option build.cmd]]} {
         # Print "Entering directory" lines for better log debugging
         return "-w [option build.target]"

Modified: branches/release_2_0/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/release_2_0/base/src/port1.0/portdestroot.tcl	2012-03-11 21:10:25 UTC (rev 90651)
+++ branches/release_2_0/base/src/port1.0/portdestroot.tcl	2012-03-11 21:13:48 UTC (rev 90652)
@@ -89,8 +89,9 @@
 set_ui_prefix
 
 proc portdestroot::destroot_getargs {args} {
-    if {((![exists build.type] && [option os.platform] != "freebsd") || ([exists build.type] && [option build.type] == "gnu")) \
-        && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option destroot.cmd]]} {
+    if {(([option build.type] == "default" && [option os.platform] != "freebsd") || \
+         ([option build.type] == "gnu")) \
+        && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option build.cmd]]} {
         # Print "Entering directory" lines for better log debugging
         return "-w [option destroot.target]"
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120311/11489728/attachment-0001.html>


More information about the macports-changes mailing list