<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/064594a79fe76ebf87fc9d7579f5d38e4e18e8a3">https://github.com/macports/macports-base/commit/064594a79fe76ebf87fc9d7579f5d38e4e18e8a3</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 064594a79fe76ebf87fc9d7579f5d38e4e18e8a3
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Thu Feb 15 00:12:04 2024 +1100
<span style='display:block; white-space:pre;color:#404040;'> portuninstall improvements
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Use dict for options, portinfo, and variations.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Don't use portlist_sortint since not only was it being passed a list in
</span><span style='display:block; white-space:pre;color:#404040;'> the wrong format, but it's defined by port.tcl and thus unlikely to
</span><span style='display:block; white-space:pre;color:#404040;'> exist when this API is used by other clients. Define a comparison proc
</span><span style='display:block; white-space:pre;color:#404040;'> to use with lsort instead.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Use fully-qualified names for infrequently used globals.
</span>---
src/registry2.0/portuninstall.tcl | 142 ++++++++++++++++++++------------------
1 file changed, 75 insertions(+), 67 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/portuninstall.tcl b/src/registry2.0/portuninstall.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 624ed81b5..e3551b0b2 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/portuninstall.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/portuninstall.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -43,15 +43,15 @@ namespace eval registry_uninstall {
</span> # generate list of all dependencies of the port
proc generate_deplist {port {optslist ""}} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run depends_test}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set deptypes [list depends_fetch depends_extract depends_patch depends_build depends_lib depends_run depends_test]
</span> set all_dependencies [list]
# look up deps from the saved portfile if possible
if {![catch {set mport [mportopen_installed [$port name] [$port version] [$port revision] [$port variants] $optslist]}]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- array set depportinfo [mportinfo $mport]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set depportinfo [mportinfo $mport]
</span> mportclose $mport
foreach type $deptypes {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists depportinfo($type)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach dep $depportinfo($type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $depportinfo $type]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach dep [dict get $depportinfo $type] {
</span> lappend all_dependencies [lindex [split $dep :] end]
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -70,70 +70,82 @@ proc generate_deplist {port {optslist ""}} {
</span> set portname [$port name]
# and the ones from the current portfile
if {![catch {mportlookup $portname} result] && [llength $result] >= 2} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- array set depportinfo [lindex $result 1]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set porturl $depportinfo(porturl)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set variations [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set depportinfo [lindex $result 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set porturl [dict get $depportinfo porturl]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set variations [dict create]
</span> # Relies on all negated variants being at the end of requested_variants
set minusvariant [lrange [split [registry::property_retrieve $port requested_variants] -] 1 end]
set plusvariant [lrange [split [$port variants] +] 1 end]
foreach v $plusvariant {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend variations $v "+"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set variations $v "+"
</span> }
foreach v $minusvariant {
if {[string first "+" $v] == -1} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend variations $v "-"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set variations $v "-"
</span> } else {
ui_warn "Invalid negated variant for $portname @[$port version]_[$port revision][$port variants]: $v"
}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![catch {set mport [mportopen $porturl [concat $optslist subport $portname] [array get variations]]} result]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array unset depportinfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set depportinfo [mportinfo $mport]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set optslist subport $portname
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![catch {set mport [mportopen $porturl $optslist $variations]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set depportinfo [mportinfo $mport]
</span> mportclose $mport
}
foreach type $deptypes {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists depportinfo($type)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach dep $depportinfo($type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $depportinfo $type]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach dep [dict get $depportinfo $type] {
</span> lappend all_dependencies [lindex [split $dep :] end]
}
}
}
}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set all_dependencies [lsort -unique $all_dependencies]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $all_dependencies
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [lsort -unique $all_dependencies]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc cmp_regrefs {a b} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set byname [string compare -nocase [$a name] [$b name]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$byname != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $byname
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set byvers [vercmp [$a version] [$b version]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$byvers != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $byvers
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set byrevision [expr {[$a revision] - [$b revision]}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$byrevision != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $byrevision
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [string compare -nocase [$a variants] [$b variants]]
</span> }
# takes a composite version spec rather than separate version,revision,variants
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc uninstall_composite {portname {v ""} {optionslist ""}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc uninstall_composite {portname {v ""} {options ""}} {
</span> if {$v eq ""} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [uninstall $portname "" "" 0 $optionslist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [uninstall $portname "" "" 0 $options]
</span> } elseif {[registry::decode_spec $v version revision variants]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [uninstall $portname $version $revision $variants $optionslist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [uninstall $portname $version $revision $variants $options]
</span> }
throw registry::invalid "Registry error: Invalid version '$v' specified for ${portname}. Please specify a version as recorded in the port registry."
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""}} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- global uninstall.force UI_PREFIX macports::registry.path
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set options $optionslist
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(subport)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc uninstall {portname {version ""} {revision ""} {variants 0} {options ""}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options subport]} {
</span> # don't want this set when calling registry::run_target
<span style='display:block; white-space:pre;background:#ffe0e0;'>- unset options(subport)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set optionslist [array get options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict unset options subport
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![info exists uninstall.force]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set uninstall.force no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![info exists ::uninstall.force]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ::uninstall.force no
</span> }
# If global forcing is on, make it the same as a local force flag.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_force)] && [string is true -strict $options(ports_force)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set uninstall.force yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_force] && [string is true -strict [dict get $options ports_force]]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ::uninstall.force yes
</span> }
# if no-exec is set for uninstall, set for deactivate too
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_no-exec)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set options(ports_deactivate_no-exec) $options(ports_uninstall_no-exec)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_no-exec]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set options ports_deactivate_no-exec [dict get $options ports_uninstall_no-exec]
</span> }
set searchkeys $portname
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -154,9 +166,9 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> set portname [[lindex $ilist 0] name]
set msg "The following versions of $portname are currently installed:"
if {[macports::ui_isset ports_noninteractive]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_msg "$UI_PREFIX [msgcat::mc $msg]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_msg "$::UI_PREFIX [msgcat::mc $msg]"
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set sortedlist [portlist_sortint $ilist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sortedlist [lsort -command cmp_regrefs $ilist]
</span> foreach i $sortedlist {
set portstr [format "%s @%s_%s%s" [$i name] [$i version] [$i revision] [$i variants]]
if {[$i state] eq "installed"} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -166,7 +178,7 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> if {[info exists macports::ui_options(questions_multichoice)]} {
lappend portilist "$portstr"
} else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_msg "$UI_PREFIX $portstr"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_msg "$::UI_PREFIX $portstr"
</span> }
}
if {[info exists macports::ui_options(questions_multichoice)]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -199,29 +211,27 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span>
set userinput {}
# uninstall dependents if requested
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_follow-dependents)] && $options(ports_uninstall_follow-dependents) eq "yes"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_follow-dependents] && [dict get $options ports_uninstall_follow-dependents] eq "yes"} {
</span> # don't uninstall dependents' dependencies
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_follow-dependencies)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set orig_follow_dependencies $options(ports_uninstall_follow-dependencies)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- unset options(ports_uninstall_follow-dependencies)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set optionslist [array get options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_follow-dependencies]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set orig_follow_dependencies [dict get $options ports_uninstall_follow-dependencies]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict unset options ports_uninstall_follow-dependencies
</span> }
foreach depport [$port dependents] {
# make sure it's still installed, since a previous dep uninstall may have removed it
if {[registry::entry exists $depport] && ([$depport state] eq "imaged" || [$depport state] eq "installed")} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $depport uninstall $optionslist]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- registry_uninstall::uninstall [$depport name] [$depport version] [$depport revision] [$depport variants] $optionslist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_no-exec] || ![registry::run_target $depport uninstall $options]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ registry_uninstall::uninstall [$depport name] [$depport version] [$depport revision] [$depport variants] $options
</span> }
}
#catch {registry::entry close $depport}
}
if {[info exists orig_follow_dependencies]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set options(ports_uninstall_follow-dependencies) $orig_follow_dependencies
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set optionslist [array get options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set options ports_uninstall_follow-dependencies $orig_follow_dependencies
</span> }
} else {
# check its dependents
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set userinput [registry::check_dependents $port ${uninstall.force} "uninstall"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set userinput [registry::check_dependents $port ${::uninstall.force} "uninstall"]
</span> if {$userinput eq "quit"} {
#registry::entry close $port
return 0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -229,36 +239,34 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> }
# if it's active, deactivate it
if {[$port state] eq "installed"} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_dryrun] && [string is true -strict [dict get $options ports_dryrun]]} {
</span> ui_msg "For $portname @${composite_spec}: skipping deactivate (dry run)"
} else {
if {$userinput eq "forcedbyuser"} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set options(ports_nodepcheck) "yes"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set options ports_nodepcheck yes
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $port deactivate [array get options]]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$userinput eq "forcedbyuser"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- portimage::deactivate $portname $version $revision $variants [array get options]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- unset options(ports_nodepcheck)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- portimage::deactivate $portname $version $revision $variants [array get options]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_no-exec] || ![registry::run_target $port deactivate $options]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ portimage::deactivate $portname $version $revision $variants $options
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$userinput eq "forcedbyuser"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict unset options ports_nodepcheck
</span> }
}
}
# note deps before we uninstall if we're going to uninstall them too (i.e. --follow-dependencies)
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_follow-dependencies)] && [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set all_dependencies [registry_uninstall::generate_deplist $port $optionslist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_follow-dependencies] && [string is true -strict [dict get $options ports_uninstall_follow-dependencies]]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set all_dependencies [registry_uninstall::generate_deplist $port $options]
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_dryrun] && [string is true -strict [dict get $options ports_dryrun]]} {
</span> ui_msg "For $portname @${composite_spec}: skipping uninstall (dry run)"
# allow deps to not be excluded from the list below just because this port is still a dependent
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_follow-dependencies)] && [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_follow-dependencies] && [string is true -strict [dict get $options ports_uninstall_follow-dependencies]]} {
</span> set uports [list [list $portname $version $revision $variants]]
}
} else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_msg "$UI_PREFIX [format [msgcat::mc "Uninstalling %s @%s"] $portname $composite_spec]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_msg "$::UI_PREFIX [format [msgcat::mc "Uninstalling %s @%s"] $portname $composite_spec]"
</span>
# Get the full path to the image file
set imagefile [$port location]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -281,7 +289,7 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> registry::entry delete $port
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set portfile_path [file join ${registry.path} registry portfiles ${portname}-${version}_${revision} $portfile]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portfile_path [file join ${::macports::registry.path} registry portfiles ${portname}-${version}_${revision} $portfile]
</span> set other_entries [registry::entry search portfile $portfile name $portname version $version revision $revision]
if {$other_entries eq {}} {
file delete -force $portfile_path
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -291,7 +299,7 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> # registry::entry close $e
#}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set reg_portgroups_dir [file join ${registry.path} registry portgroups]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set reg_portgroups_dir [file join ${::macports::registry.path} registry portgroups]
</span> foreach pg $portgroups {
set pgname [lindex $pg 0]
set pgversion [lindex $pg 1]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -313,7 +321,7 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> set uports [list]
}
# create list of all dependencies that will be uninstalled, if requested
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_follow-dependencies)] && [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_follow-dependencies] && [string is true -strict [dict get $options ports_uninstall_follow-dependencies]]} {
</span> set alldeps $all_dependencies
set portilist [list]
for {set j 0} {$j < [llength $alldeps]} {incr j} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -349,7 +357,7 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> if {$uninstalling_this_dep} {
set deprefs [registry::entry imaged $dep]
foreach depref $deprefs {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set depdeps [registry_uninstall::generate_deplist $depref $optionslist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set depdeps [registry_uninstall::generate_deplist $depref $options]
</span> foreach d $depdeps {
if {$d ni [lrange $alldeps $j+1 end]} {
lappend alldeps $d
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -361,23 +369,23 @@ proc uninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""
</span> }
## User Interaction Question
# show a list of all dependencies to be uninstalled with a timeout when --follow-dependencies is specified
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists macports::ui_options(questions_yesno)] && [llength $uports] > 0 && !([info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)])} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists macports::ui_options(questions_yesno)] && [llength $uports] > 0 && !([dict exists $options ports_dryrun] && [string is true -strict [dict get $options ports_dryrun]])} {
</span> $macports::ui_options(questions_yesno) "The following dependencies will be uninstalled:" "Timeout_1" $portilist {y} 10
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- unset options(ports_uninstall_follow-dependencies)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict unset options ports_uninstall_follow-dependencies
</span> }
# uninstall all dependencies in order from uports
foreach dp $uports {
lassign $dp iname iversion irevision ivariants
if {![catch {registry::entry open $iname $iversion $irevision $ivariants ""} regref]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_dryrun] && [string is true -strict [dict get $options ports_dryrun]]} {
</span> if {$iname ne $portname} {
ui_msg "For $iname @${iversion}_${irevision}${ivariants}: skipping uninstall (dry run)"
}
} else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $regref uninstall [array get options]]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- registry_uninstall::uninstall $iname $iversion $irevision $ivariants [array get options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $options ports_uninstall_no-exec] || ![registry::run_target $regref uninstall $options]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ registry_uninstall::uninstall $iname $iversion $irevision $ivariants $options
</span> }
}
#registry::entry close $regref
</pre><pre style='margin:0'>
</pre>