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

ijackson at macports.org ijackson at macports.org
Thu Jul 30 10:38:06 PDT 2015


Revision: 139046
          https://trac.macports.org/changeset/139046
Author:   ijackson at macports.org
Date:     2015-07-30 10:38:06 -0700 (Thu, 30 Jul 2015)
Log Message:
-----------
Add solv's returned by libsolv to dlist for installation.
List of ports to be installed returned by libsolv is alphabetically
sorted, hence make use of dlist and ditem to add requires ports
to topologically sort the installation list.

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-30 16:33:07 UTC (rev 139045)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports.tcl	2015-07-30 17:38:06 UTC (rev 139046)
@@ -2024,21 +2024,38 @@
         set dep_res [macports::libsolv::dep_calc $portlist]
         ## Install each port. First use mportopen and then _mportexec.
         if {[info exists dep_res]} {
+            set dlist [list]
+            set portlist [list]
             foreach port $dep_res {
-                set portname [lindex $port 0]
+                set portsolv [lindex $port 0]
+                lappend portlist [$portsolv cget -name]
+            }
+            ui_debug "Printing portlist"
+            ui_debug $portlist
+            foreach port $dep_res {
+                set portsolv [lindex $port 0]
+                set portname [$portsolv cget -name]
                 set porturl [lindex $port 1]
-                ui_debug "Installing $portname"
                 set options(subport) $portname
-                ui_debug "mportopen $porturl [list subport $portname]"
+                
+                puts "Current: $portname"  
                 set mport [mportopen $porturl [list subport $portname]]
-                set result [_mportexec activate $mport]
+                foreach dep [$portsolv lookup_deparray $solv::SOLVABLE_REQUIRES] {
+                    set depname [$dep __str__]
+                    if {$depname ni $portlist} {
+                        continue
+                    }
+                    puts "Adding $depname to requires"
+                    ditem_append_unique $mport requires $depname
+                }
+                lappend dlist $mport
             }
+            set result [dlist_eval $dlist _mportactive [list _mportexec activate]]
             if {[info exists result]} {
                 return $result
-            } else {
-                return {}
             }
         }
+        return {}
     }
 }
 

Modified: branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl
===================================================================
--- branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl	2015-07-30 16:33:07 UTC (rev 139045)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl	2015-07-30 17:38:06 UTC (rev 139046)
@@ -437,7 +437,7 @@
                     puts [$p __str__]
                     array set portinfo $portindexinfo([$p cget -id])
                     set porturl "file://[[$p cget -repo] cget -name]/${portinfo(portdir)}"
-                    lappend install_list [list [$p cget -name] $porturl] 
+                    lappend install_list [list $p $porturl] 
                     array unset -nocomplain portinfo
                 }
             }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150730/8d3c6ac4/attachment.html>


More information about the macports-changes mailing list