[138375] branches/gsoc15-dependency/base/src/macports1.0

ijackson at macports.org ijackson at macports.org
Mon Jul 6 10:45:16 PDT 2015


Revision: 138375
          https://trac.macports.org/changeset/138375
Author:   ijackson at macports.org
Date:     2015-07-06 10:45:15 -0700 (Mon, 06 Jul 2015)
Log Message:
-----------
Call create_pool from macports_libsolv.tcl instead of macports.tcl
Instead of calling macports::libsolv::create_pool in macports.tcl
do set pool [create_pool] wherever $pool is required i.e search and
depcalc. In dep_calc add {*} so that jobs can be appended with multiple
ports. Configure Jobs about how to continue with the ports i.e Installing
them.

Modified Paths:
--------------
    branches/gsoc15-dependency/base/src/macports1.0/macports.tcl
    branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl

Modified: branches/gsoc15-dependency/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc15-dependency/base/src/macports1.0/macports.tcl	2015-07-06 17:31:00 UTC (rev 138374)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports.tcl	2015-07-06 17:45:15 UTC (rev 138375)
@@ -2049,9 +2049,10 @@
 
     ## Use libsolv Dependency Calculation if -l is passed
     if {[info exists macports::global_options(ports_depengine)]} {
-        if {[macports::_target_needs_deps $target]} {
-            macports::libsolv::create_pool
-            set dep_res [macports::libsolv::dep_calc $portname]
+        if {$macports::global_options(ports_depengine) eq "libsolv"} {
+            if {[macports::_target_needs_deps $target]} {
+                set dep_res [macports::libsolv::dep_calc $portname]
+            }
         }
     }
 
@@ -2750,7 +2751,6 @@
     ## Use libsolv search if -l is passed
     if {[info exists macports::global_options(ports_depengine)]} {
         if {$macports::global_options(ports_depengine) eq "libsolv"} {
-            macports::libsolv::create_pool
             # macports::libsolv::print
             set search_res [macports::libsolv::search $pattern \
             $case_sensitive $matchstyle $field]

Modified: branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl
===================================================================
--- branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl	2015-07-06 17:31:00 UTC (rev 138374)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl	2015-07-06 17:45:15 UTC (rev 138375)
@@ -160,9 +160,8 @@
             ## createwhatprovides creates hash over all the provides of the package \
             #  This method is necessary before we can run any lookups on provides.
             $pool createwhatprovides
-        } else {
-            return {}
         }
+        return $pool
     }
 
     ## Search using libsolv. Needs some more work.
@@ -175,7 +174,7 @@
     #  Add more info to the solv's to search into more details of the ports (description, \
     #  homepage, category, etc.
     proc search {pattern {case_sensitive yes} {matchstyle regexp} {field name}} {
-        variable pool
+        set pool [create_pool]
         variable portindexinfo
 
         set matches [list]
@@ -250,7 +249,7 @@
 
     ## Dependency calculation using libsolv
     proc dep_calc {portname} {
-        variable pool
+        set pool [create_pool]
         ui_msg "$macports::ui_prefix Computing dependencies for $portname using libsolv"
         set jobs [list]
         foreach arg $portname {
@@ -262,7 +261,10 @@
             if {[$sel isempty]} {
                 set sel [$pool select $arg [expr $flags | $solv::Selection_SELECTION_NOCASE]]
             }
-            lappend jobs [$sel jobs $solv::Job_SOLVER_INSTALL]
+            lappend jobs {*}[$sel jobs $solv::Job_SOLVER_INSTALL]
         }
+        foreach job $jobs { 
+            $job configure -how $solv::Job_SOLVER_INSTALL
+        }
     }
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150706/dc8cfa09/attachment.html>


More information about the macports-changes mailing list