[146703] trunk/base/src/macports1.0/macports.tcl

cal at macports.org cal at macports.org
Tue Mar 15 09:07:20 PDT 2016


Revision: 146703
          https://trac.macports.org/changeset/146703
Author:   cal at macports.org
Date:     2016-03-15 09:07:20 -0700 (Tue, 15 Mar 2016)
Log Message:
-----------
base: macports1.0: Avoid trace when ^C-ing reclaim

Signals in reclaim code could cause the error to bubble up into the Tcl
interpreter. To avoid a stacktrace being printed, catch the error and return an
error code.

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2016-03-15 15:53:53 UTC (rev 146702)
+++ trunk/base/src/macports1.0/macports.tcl	2016-03-15 16:07:20 UTC (rev 146703)
@@ -4478,7 +4478,6 @@
 }
 
 proc macports::reclaim_main {} {
-
     # Calls the main function for the 'port reclaim' command.
     #
     # Args:
@@ -4486,7 +4485,19 @@
     # Returns:
     #           None
 
-    reclaim::main
+    try {
+        reclaim::main
+    } catch {{POSIX SIG SIGINT} eCode eMessage} {
+        ui_error [msgcat::mc "reclaim aborted: SIGINT received."]
+        return 2
+    } catch {{POSIX SIG SIGTERM} eCode eMessage} {
+        ui_error [msgcat::mc "reclaim aborted: SIGTERM received."]
+        return 2
+    } catch {{*} eCode eMessage} {
+        ui_debug "reclaim failed: $::errorInfo"
+        ui_error [msgcat::mc "reclaim failed: %s" $eMessage]
+        return 1
+    }
     return 0
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160315/285788e7/attachment.html>


More information about the macports-changes mailing list