<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.7
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/9d8fee99d9b807d7903c4da8f1777f17aa716c60">https://github.com/macports/macports-base/commit/9d8fee99d9b807d7903c4da8f1777f17aa716c60</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 9d8fee99d9b807d7903c4da8f1777f17aa716c60
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sat Jan 15 22:24:16 2022 +1100
<span style='display:block; white-space:pre;color:#404040;'> mportexec usage fixes
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Make sure to check the return value.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit b86410913b9fba4a496be34865f36a02bf37bc36)
</span>---
src/macports1.0/macports.tcl | 13 ++++++++++---
src/port/port.tcl | 2 +-
src/registry2.0/registry_util.tcl | 8 +++++++-
3 files changed, 18 insertions(+), 5 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 35d76b60..390226af 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;'>@@ -3937,13 +3937,12 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> return $status
}
# now install it
<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:#e0ffe0;'>+ if {[catch {mportexec $mport activate} result]} {
</span> ui_debug $::errorInfo
ui_error "Unable to exec port: $result"
catch {mportclose $mport}
return 1
<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:#e0ffe0;'>+ } elseif {$result != 0} {
</span> ui_error "Problem while installing $portname"
catch {mportclose $mport}
return $result
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4350,8 +4349,14 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> }
ui_msg "Skipping activate $newname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
} else {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set failed 0
</span> if {[catch {mportexec $mport activate} result]} {
ui_debug $::errorInfo
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set failed 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$result != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set failed 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$failed} {
</span> ui_error "Couldn't activate $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants): $result"
catch {mportclose $mport}
return 1
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4361,6 +4366,8 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> if {[catch {mportexec $mport load} result]} {
ui_debug $::errorInfo
ui_warn "Error loading startupitem(s) for ${newname}: $result"
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$result != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_warn "Error loading startupitem(s) for ${newname}: $result"
</span> }
$workername eval "unset ::portstartupitem::load_only"
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port/port.tcl b/src/port/port.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 121abf78..4ffc65f2 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4206,7 +4206,7 @@ proc action_target { action portlist opts } {
</span> ui_debug $::errorInfo
break_softcontinue "Unable to open port: $result" 1 status
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {set result [mportexec $workername $target]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {mportexec $workername $target} result]} {
</span> ui_debug $::errorInfo
mportclose $workername
break_softcontinue "Unable to execute port: $result" 1 status
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/registry_util.tcl b/src/registry2.0/registry_util.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 5aca79c7..33cdb0e5 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/registry_util.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/registry_util.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -116,8 +116,14 @@ proc run_target {port target options} {
</span> }
if {![catch {set mport [mportopen_installed [$port name] [$port version] [$port revision] [$port variants] $options]}]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {set result [mportexec $mport $target]} result] || $result != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set failed 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {mportexec $mport $target} result]} {
</span> ui_debug $::errorInfo
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set failed 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$result != 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set failed 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$failed} {
</span> catch {mportclose $mport}
ui_warn "Failed to execute portfile from registry for $portspec"
switch $target {
</pre><pre style='margin:0'>
</pre>