Changeset 141397 for trunk/base


Ignore:
Timestamp:
Oct 17, 2015, 1:09:17 PM (4 years ago)
Author:
cal@…
Message:

base: portclean: make signal-aware and re-throw error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portclean.tcl

    r116449 r141397  
    215215    if {[file isdirectory $subbuildpath]} {
    216216        ui_debug "Removing directory: ${subbuildpath}"
    217         if {[catch {delete $subbuildpath} result]} {
     217        try {
     218            delete $subbuildpath
     219        } catch {{POSIX SIG SIGINT} eCode eMessage} {
     220            ui_debug [msgcat::mc "Aborted due to SIGINT"]
     221            throw
     222        } catch {{POSIX SIG SINTERM} eCode eMessage} {
     223            ui_debug [msgcat::mc "Aborted due to SIGTERM"]
     224            throw
     225        } catch {{*} eCode eMessage} {
    218226            ui_debug "$::errorInfo"
    219             ui_error "$result"
     227            ui_error "$eMessage"
    220228        }
    221229        # silently fail if non-empty (other subports might be using portbuildpath)
     
    227235    if {!$usealtworkpath && [file isdirectory ${altprefix}${subbuildpath}]} {
    228236        ui_debug "Removing directory: ${altprefix}${subbuildpath}"
    229         if {[catch {delete ${altprefix}${subbuildpath}} result]} {
     237        try {
     238            delete ${altprefix}${subbuildpath}
     239        } catch {{POSIX SIG SIGINT} eCode eMessage} {
     240            ui_debug [msgcat::mc "Aborted due to SIGINT"]
     241            throw
     242        } catch {{POSIX SIG SINTERM} eCode eMessage} {
     243            ui_debug [msgcat::mc "Aborted due to SIGTERM"]
     244            throw
     245        } catch {{*} eCode eMessage} {
    230246            ui_debug "$::errorInfo"
    231             ui_error "$result"
     247            ui_error "$eMessage"
    232248        }
    233249        catch {file delete ${altprefix}${portbuildpath}}
Note: See TracChangeset for help on using the changeset viewer.