[137952] branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv. tcl
ijackson at macports.org
ijackson at macports.org
Tue Jun 23 11:53:20 PDT 2015
Revision: 137952
https://trac.macports.org/changeset/137952
Author: ijackson at macports.org
Date: 2015-06-23 11:53:20 -0700 (Tue, 23 Jun 2015)
Log Message:
-----------
Add dependency information to the solv's
Add build and runtime dependencies to the solvables
using depends_fetch, depends_extract, depends_build,
depends_lib and depends_run fields from PortIndex.
Add it during creating solv's as Id will be unique
for all strings i.e. solv-name. Id will be created
if dependent solv does not exists and during solv creation,
Id will be looked up from this map of <string, Id>.
Modified Paths:
--------------
branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl
Modified: branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl
===================================================================
--- branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl 2015-06-23 18:48:35 UTC (rev 137951)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl 2015-06-23 18:53:20 UTC (rev 137952)
@@ -120,10 +120,51 @@
if {[info exists portinfo(categories)]} {
$repodata set_str $solvid $solv::SOLVABLE_CATEGORY $portinfo(categories)
}
+ ## Add dependency information to solvable using portinfo
+ # $marker i.e last arg to add_deparray is set to 1 for build dependencies
+ # and -1 for runtime dependencies
+ ## Add Build dependencies:
+ if {[info exists portinfo(depends_fetch)]} {
+ foreach dep $portinfo(depends_fetch) {
+ set dep_name [lindex [split $dep :] end]
+ $solvable add_deparray $solv::SOLVABLE_REQUIRES \
+ [$pool str2id $dep_name 1] 1
+ }
+ }
+ if {[info exists portinfo(depends_extract)]} {
+ foreach dep $portinfo(depends_extract) {
+ set dep_name [lindex [split $dep :] end]
+ $solvable add_deparray $solv::SOLVABLE_REQUIRES \
+ [$pool str2id $dep_name 1] 1
+ }
+ }
+ if {[info exists portinfo(depends_build)]} {
+ foreach dep $portinfo(depends_build) {
+ set dep_name [lindex [split $dep :] end]
+ $solvable add_deparray $solv::SOLVABLE_REQUIRES \
+ [$pool str2id $dep_name 1] 1
+ }
+ }
+ ## Add Runtime dependencies
+ if {[info exists portinfo(depends_lib)]} {
+ foreach dep $portinfo(depends_lib) {
+ set dep_name [lindex [split $dep :] end]
+ $solvable add_deparray $solv::SOLVABLE_REQUIRES \
+ [$pool str2id $dep_name 1] -1
+ }
+ }
+ if {[info exists portinfo(depends_run)]} {
+ foreach dep $portinfo(depends_run) {
+ set dep_name [lindex [split $dep :] end]
+ $solvable add_deparray $solv::SOLVABLE_REQUIRES \
+ [$pool str2id $dep_name 1] -1
+ }
+ }
## Set portinfo of each solv object. Map it to correct solvid.
set portindexinfo([$solvable cget -id]) $line
}
+
} catch * {
ui_warn "It looks like your PortIndex file for $source may be corrupt."
throw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150623/64c0b6fa/attachment-0001.html>
More information about the macports-changes
mailing list