<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/7457e89337a39d15702af3fd33312ce45cb91abd">https://github.com/macports/macports-base/commit/7457e89337a39d15702af3fd33312ce45cb91abd</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 7457e89337a39d15702af3fd33312ce45cb91abd
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Thu Dec 15 17:16:21 2016 +0100
<span style='display:block; white-space:pre;color:#404040;'> Move reclaim check to port client
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Only check for a pending reclaim if the executed command was successful
</span><span style='display:block; white-space:pre;color:#404040;'> to avoid unnecessary clutter in case of a failure.
</span>---
src/macports1.0/macports.tcl | 32 +++++++++++++++++++++++++++-----
src/port/port.tcl | 5 +++++
2 files changed, 32 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 52af194..5a2bb86 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;'>@@ -1250,11 +1250,6 @@ proc mportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
</span>
# call this just before you exit
proc mportshutdown {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Check the last time 'reclaim' was run and run it
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![macports::ui_isset ports_quiet]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- reclaim::check_last_run
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # save ping times
global macports::ping_cache macports::portdbpath
if {[file writable $macports::portdbpath]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4375,6 +4370,33 @@ proc macports::diagnose_main {opts} {
</span> return 0
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+##
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Run reclaim if necessary
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# @return 0 on success, 1 if an exception occured during the execution
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# of reclaim, 2 if the execution was aborted on user request.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc macports::reclaim_check_and_run {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[macports::ui_isset ports_quiet]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</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;'>+ try {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reclaim::check_last_run
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } catch {{POSIX SIG SIGINT} eCode eMessage} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error [msgcat::mc "reclaim aborted: SIGINT received."]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } catch {{POSIX SIG SIGTERM} eCode eMessage} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error [msgcat::mc "reclaim aborted: SIGTERM received."]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } catch {{*} eCode eMessage} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "reclaim failed: $::errorInfo"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error [msgcat::mc "reclaim failed: %s" $eMessage]
</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;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc macports::reclaim_main {opts} {
# Calls the main function for the 'port reclaim' command.
#
<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 46c89a0..dda91d0 100644
</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;'>@@ -5801,6 +5801,11 @@ if {$exit_status == -999} {
</span> set exit_status 0
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Check the last time 'reclaim' was run and run it
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {$exit_status == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ macports::reclaim_check_and_run
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # shut down macports1.0
mportshutdown
</pre><pre style='margin:0'>
</pre>