<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/2f9690b5f2bd72c24a8cceca1c7fe52044bf1e54">https://github.com/macports/macports-base/commit/2f9690b5f2bd72c24a8cceca1c7fe52044bf1e54</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 2f9690b5f snapshot.tcl: use registry2 API
</span>2f9690b5f is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 2f9690b5f2bd72c24a8cceca1c7fe52044bf1e54
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri May 24 18:20:03 2024 +1000
<span style='display:block; white-space:pre;color:#404040;'> snapshot.tcl: use registry2 API
</span>---
src/macports1.0/snapshot.tcl | 53 ++++++++++++++++++--------------------------
1 file changed, 22 insertions(+), 31 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/snapshot.tcl b/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 8b5e95f3c..a944d99a7 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -197,15 +197,13 @@ namespace eval snapshot {
</span>
set best_match {}
set best_match_score -1
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach iport $installed {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lassign $iport iname iversion irevision ivariants iactive iepoch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set regref [registry::open_entry $iname $iversion $irevision $ivariants $iepoch]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set iplatform [registry::property_retrieve $regref os_platform]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set iosmajor [registry::property_retrieve $regref os_major]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set irequested [expr {[registry::property_retrieve $regref requested] == 1}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set irequested_variants [registry::property_retrieve $regref requested_variants]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[_os_mismatch $iplatform $iosmajor]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach regref $installed {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ivariants [$regref variants]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set iactive [expr {[$regref state] eq "installed"}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set irequested [expr {[$regref requested] == 1}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set irequested_variants [$regref requested_variants]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[_os_mismatch [$regref os_platform] [$regref os_major]]} {
</span> # ignore ports that were not built on the current macOS version
continue
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -227,7 +225,9 @@ namespace eval snapshot {
</span>
if {$score > $best_match_score} {
set best_match_score $score
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set best_match [list {*}$iport $irequested $irequested_variants]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set best_match [list [$regref name] [$regref version] \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [$regref revision] $ivariants $iactive [$regref epoch] \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $irequested $irequested_variants]
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -267,7 +267,7 @@ namespace eval snapshot {
</span>
dict set snapshot_ports $name 1
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {set installed [registry::installed $name]}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {set installed [registry::entry imaged $name]}] || $installed eq ""} {
</span> # registry::installed failed, the port probably isn't installed
lappend removed $port
continue
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -277,20 +277,16 @@ namespace eval snapshot {
</span> # for ports that were active in the snapshot, always compare
# with the installed active port, if any
set found 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach installed_port $installed {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lassign $installed_port iname iversion irevision ivariants iactive iepoch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set regref [registry::open_entry $iname $iversion $irevision $ivariants $iepoch]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set iplatform [registry::property_retrieve $regref os_platform]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set iosmajor [registry::property_retrieve $regref os_major]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set irequested [expr {[registry::property_retrieve $regref requested] == 1}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set irequested_variants [registry::property_retrieve $regref requested_variants]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[_os_mismatch $iplatform $iosmajor]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach regref $installed {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[_os_mismatch [$regref os_platform] [$regref os_major]]} {
</span> # ignore ports that were not built on the current macOS version
continue
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$iactive} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[$regref state] eq "installed"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set irequested [expr {[$regref requested] == 1}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ivariants [$regref variants]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set irequested_variants [$regref requested_variants]
</span> set found 1
break
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -349,25 +345,20 @@ namespace eval snapshot {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach port [registry::entry imaged] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lassign $installed_port iname iversion irevision ivariants iactive iepoch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set regref [registry::open_entry $iname $iversion $irevision $ivariants $iepoch]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set iplatform [registry::property_retrieve $regref os_platform]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set iosmajor [registry::property_retrieve $regref os_major]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set irequested [registry::property_retrieve $regref requested]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set irequested_variants [registry::property_retrieve $regref requested_variants]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[_os_mismatch $iplatform $iosmajor]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach regref [registry::entry imaged] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[_os_mismatch [$regref os_platform] [$regref os_major]]} {
</span> # port was installed on old OS, ignore
continue
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set iname [$regref name]
</span> if {[dict exists $snapshot_ports $iname]} {
# port was in the snapshot
continue
}
# port was not in the snapshot, it is new
<span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend added [list $iname $irequested $iactive $ivariants $irequested_variants]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set iactive [expr {[$regref state] eq "installed"}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend added [list $iname [$regref requested] $iactive [$regref variants] [$regref requested_variants]]
</span> }
return [list removed $removed added $added changed $changed]
</pre><pre style='margin:0'>
</pre>