[137445] branches/gsoc15-dependency/base/src/macports1.0
ijackson at macports.org
ijackson at macports.org
Thu Jun 11 13:31:50 PDT 2015
Revision: 137445
https://trac.macports.org/changeset/137445
Author: ijackson at macports.org
Date: 2015-06-11 13:31:50 -0700 (Thu, 11 Jun 2015)
Log Message:
-----------
WIP: Create libsolv pool by reading PortIndex
Add a check if libsolv pool exists or not. This lets
us call create_pool {} whenever libsolv pool is required
i.e. when -l option is passed. Create the pool only
if the pool does not exists (Needs some more work).
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-06-11 20:20:23 UTC (rev 137444)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports.tcl 2015-06-11 20:31:50 UTC (rev 137445)
@@ -2742,6 +2742,7 @@
if {[info exists macports::global_options(ports_depengine)]} {
if {$macports::global_options(ports_depengine) eq "libsolv"} {
macports::libsolv::print
+ macports::libsolv::create_pool
}
}
set found 0
Modified: branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl
===================================================================
--- branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl 2015-06-11 20:20:23 UTC (rev 137444)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl 2015-06-11 20:31:50 UTC (rev 137445)
@@ -43,23 +43,50 @@
#puts $pool
namespace eval macports::libsolv {
+
+ ## Variable to keep check if libsolv cache is created or not.
+ variable libsolv_pool
+
proc print {} {
puts $solv::Job_SOLVER_SOLVABLE
}
proc create_pool {} {
- global macports::sources
- set pool [solv::Pool]
+ variable libsolv_pool
- foreach source $sources {
- set source [lindex $source 0]
+ if {![info exists libsolv_pool]} {
+ global macports::sources
+ set matches [list]
+
+ set pool [solv::Pool]
+
+ foreach source $sources {
+ set source [lindex $source 0]
+ set repo [$pool add_repo $source]
- if {[catch {set fd [open [macports::getindex $source] r]} result]} {
- ui_warn "Can't open index file for source: $source"
- } else {
- # pool::add_repo($fd)
+ if {[catch {set fd [open [macports::getindex $source] r]} result]} {
+ ui_warn "Can't open index file for source: $source"
+ } else {
+ try {
+ #incr found 1
+ while {[gets $fd line] >= 0} {
+ #puts $line
+ array unset portinfo
+ set name [lindex $line 0]
+ set len [lindex $line 1]
+ set line [read $fd $len]
+
+ #puts "\nname = ${name}\n"
+ set solvable [$repo add_solv $name]
+ }
+ }
+ }
}
- }
+ set libsovl_pool $pool
+ #puts $pool
+ } else {
+ return {}
+ }
}
proc search {pattern} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150611/14409e1e/attachment.html>
More information about the macports-changes
mailing list