<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/9896034b1cf452ee905d61e9fcdee739d4112926">https://github.com/macports/macports-base/commit/9896034b1cf452ee905d61e9fcdee739d4112926</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 9896034b separate not-installed and error cases in _upgrade
</span>9896034b is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 9896034b1cf452ee905d61e9fcdee739d4112926
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sat Jun 26 07:59:39 2021 +1000
<span style='display:block; white-space:pre;color:#404040;'> separate not-installed and error cases in _upgrade
</span>---
src/macports1.0/macports.tcl | 110 +++++++++++++++++++++----------------------
1 file changed, 54 insertions(+), 56 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 0f361dae..18109018 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;'>@@ -3922,66 +3922,64 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> set portname $portinfo(name)
set options(subport) $portname
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {registry::entry imaged $portname} result] || $result eq {}} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$result eq {}} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "$portname is *not* installed by MacPorts"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # We need to pass _mportispresent a reference to the mport that is
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # actually declaring the dependency on the one we're checking for.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # We got here via _upgrade_dependencies, so we grab it from 2 levels up.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- upvar 2 mport parentmport
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![_mportispresent $parentmport $dspec]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # open porthandle
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set porturl $portinfo(porturl)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![info exists porturl]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set porturl file://./
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Grab the variations from the parent
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- upvar 2 variations variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {registry::entry imaged $portname} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Checking installed version failed: $result"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$result eq {}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "$portname is *not* installed by MacPorts"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # We need to pass _mportispresent a reference to the mport that is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # actually declaring the dependency on the one we're checking for.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # We got here via _upgrade_dependencies, so we grab it from 2 levels up.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ upvar 2 mport parentmport
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![_mportispresent $parentmport $dspec]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # open porthandle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set porturl $portinfo(porturl)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![info exists porturl]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set porturl file://./
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Grab the variations from the parent
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ upvar 2 variations variations
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {set mport [mportopen $porturl [array get options] [array get variations]]} result]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug $::errorInfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "Unable to open port: $result"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # While we're at it, update the portinfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array unset portinfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set portinfo [mportinfo $mport]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # mark it in the cache now to guard against circular dependencies
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set depscache(port:$portname) 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # upgrade its dependencies first
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set status [_upgrade_dependencies portinfo depscache variationslist options]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$status != 0 && $status != 2 && ![ui_isset ports_processall]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- catch {mportclose $mport}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $status
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # now install it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {set result [mportexec $mport activate]} result]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug $::errorInfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "Unable to exec port: $result"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- catch {mportclose $mport}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$result > 0} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "Problem while installing $portname"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- catch {mportclose $mport}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $result
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mportclose $mport
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # dependency is satisfied by something other than the named port
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "$portname not installed, soft dependency satisfied"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # mark this depspec as satisfied in the cache
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set depscache($dspec) 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {set mport [mportopen $porturl [array get options] [array get variations]]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug $::errorInfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Unable to open port: $result"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 1
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # the rest of the proc doesn't matter for a port that is freshly
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # installed or not installed
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # While we're at it, update the portinfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ array unset portinfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ array set portinfo [mportinfo $mport]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # mark it in the cache now to guard against circular dependencies
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set depscache(port:$portname) 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # upgrade its dependencies first
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set status [_upgrade_dependencies portinfo depscache variationslist options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$status != 0 && $status != 2 && ![ui_isset ports_processall]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ catch {mportclose $mport}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $status
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # now install it
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {set result [mportexec $mport activate]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug $::errorInfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Unable to exec port: $result"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ catch {mportclose $mport}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$result > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Problem while installing $portname"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ catch {mportclose $mport}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $result
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mportclose $mport
</span> } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "Checking installed version failed: $result"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # dependency is satisfied by something other than the named port
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "$portname not installed, soft dependency satisfied"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # mark this depspec as satisfied in the cache
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set depscache($dspec) 1
</span> }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # the rest of the proc doesn't matter for a port that is freshly
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # installed or not installed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span> } else {
# we'll now take care of upgrading it, so we can add it to the cache
set depscache(port:$portname) 1
</pre><pre style='margin:0'>
</pre>