[141397] trunk/base/src/port1.0/portclean.tcl

cal at macports.org cal at macports.org
Sat Dec 12 01:21:33 PST 2015


Revision: 141397
          https://trac.macports.org/changeset/141397
Author:   cal at macports.org
Date:     2015-10-17 06:09:17 -0700 (Sat, 17 Oct 2015)
Log Message:
-----------
base: portclean: make signal-aware and re-throw error

Modified Paths:
--------------
    trunk/base/src/port1.0/portclean.tcl

Modified: trunk/base/src/port1.0/portclean.tcl
===================================================================
--- trunk/base/src/port1.0/portclean.tcl	2015-10-17 11:07:46 UTC (rev 141396)
+++ trunk/base/src/port1.0/portclean.tcl	2015-10-17 13:09:17 UTC (rev 141397)
@@ -214,9 +214,17 @@
 
     if {[file isdirectory $subbuildpath]} {
         ui_debug "Removing directory: ${subbuildpath}"
-        if {[catch {delete $subbuildpath} result]} {
+        try {
+            delete $subbuildpath
+        } catch {{POSIX SIG SIGINT} eCode eMessage} {
+            ui_debug [msgcat::mc "Aborted due to SIGINT"]
+            throw
+        } catch {{POSIX SIG SINTERM} eCode eMessage} {
+            ui_debug [msgcat::mc "Aborted due to SIGTERM"]
+            throw
+        } catch {{*} eCode eMessage} {
             ui_debug "$::errorInfo"
-            ui_error "$result"
+            ui_error "$eMessage"
         }
         # silently fail if non-empty (other subports might be using portbuildpath)
         catch {file delete $portbuildpath}
@@ -226,9 +234,17 @@
 
     if {!$usealtworkpath && [file isdirectory ${altprefix}${subbuildpath}]} {
         ui_debug "Removing directory: ${altprefix}${subbuildpath}"
-        if {[catch {delete ${altprefix}${subbuildpath}} result]} {
+        try {
+            delete ${altprefix}${subbuildpath}
+        } catch {{POSIX SIG SIGINT} eCode eMessage} {
+            ui_debug [msgcat::mc "Aborted due to SIGINT"]
+            throw
+        } catch {{POSIX SIG SINTERM} eCode eMessage} {
+            ui_debug [msgcat::mc "Aborted due to SIGTERM"]
+            throw
+        } catch {{*} eCode eMessage} {
             ui_debug "$::errorInfo"
-            ui_error "$result"
+            ui_error "$eMessage"
         }
         catch {file delete ${altprefix}${portbuildpath}}
     } else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/19d1da5f/attachment.html>


More information about the macports-changes mailing list