<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/117399dbea4fb9eeb3ffbbe02a63b4810374822c">https://github.com/macports/macports-base/commit/117399dbea4fb9eeb3ffbbe02a63b4810374822c</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 117399dbea4fb9eeb3ffbbe02a63b4810374822c
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Dec 2 23:08:38 2016 +1100
<span style='display:block; white-space:pre;color:#404040;'> Use registry2 API in much of macports.tcl
</span>---
src/macports1.0/macports.tcl | 41 ++++++++++++++++-------------------------
1 file changed, 16 insertions(+), 25 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 763626d..44b02a8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1907,16 +1907,13 @@ proc _mportinstalled {mport} {
</span>
# Determine if a port is active
proc _mportactive {mport} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set workername [ditem_key $mport workername]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![catch {set reslist [$workername eval {registry_active $subport}]}] && [llength $reslist] > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portname [ditem_key $mport provides]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set reslist [registry::entry installed $portname]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$reslist ne {}} {
</span> set i [lindex $reslist 0]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set name [lindex $i 0]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set version [lindex $i 1]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set revision [lindex $i 2]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set variants [lindex $i 3]
</span> array set portinfo [mportinfo $mport]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$name eq $portinfo(name) && $version eq $portinfo(version)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- && $revision == $portinfo(revision) && $variants eq $portinfo(canonical_active_variants)} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[$i version] eq $portinfo(version) && [$i revision] == $portinfo(revision)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ && [$i variants] eq $portinfo(canonical_active_variants)} {
</span> return 1
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1925,11 +1922,7 @@ proc _mportactive {mport} {
</span>
# Determine if the named port is active
proc _portnameactive {portname} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {set reslist [registry::active $portname]}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return [expr {[llength $reslist] > 0}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [expr {[registry::entry installed $portname] ne {}}]
</span> }
### _mportispresent is private; may change without notice
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2301,11 +2294,9 @@ proc macports::_upgrade_mport_deps {mport target} {
</span>
# get the archs with which the active version of portname is installed
proc macports::_get_registry_archs {portname} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set ilist [registry::active $portname]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ilist [registry::entry installed $portname]
</span> set i [lindex $ilist 0]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set regref [registry::open_entry [lindex $i 0] [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set archs [registry::property_retrieve $regref archs]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$archs == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {$i archs} archs]} {
</span> set archs {}
}
return $archs
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3466,11 +3457,11 @@ proc macports::_active_supports_archs {portname required_archs} {
</span> if {$required_archs eq "noarch"} {
return 1
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {registry::active $portname}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[registry::entry installed $portname] eq ""} {
</span> return 0
}
set provided_archs [_active_archs $portname]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$provided_archs eq "noarch" || $provided_archs eq "" || $provided_archs == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$provided_archs eq "noarch" || $provided_archs eq ""} {
</span> return 1
}
foreach arch $required_archs {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3483,12 +3474,12 @@ proc macports::_active_supports_archs {portname required_archs} {
</span>
# get the archs for a given active port
proc macports::_active_archs {portname} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {set ilist [registry::active $portname]}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ilist [registry::entry installed $portname]
</span> set i [lindex $ilist 0]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set regref [registry::open_entry $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return [registry::property_retrieve $regref archs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {$i archs} archs]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set archs {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $archs
</span> }
# print an error message explaining why a port's archs are not provided by a dependency
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3608,7 +3599,7 @@ proc macports::selfupdate {{optionslist {}} {updatestatusvar {}}} {
</span> # 3 = port not installed
proc macports::upgrade {portname dspec variationslist optionslist {depscachename {}}} {
# only installed ports can be upgraded
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![registry::entry_exists_for_name $portname]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[registry::entry imaged $portname] eq {}} {
</span> ui_error "$portname is not installed"
return 3
}
</pre><pre style='margin:0'>
</pre>