Changeset 118298 for trunk/base


Ignore:
Timestamp:
Mar 29, 2014, 3:47:26 PM (10 years ago)
Author:
cal@…
Message:

base: setup signal handling in mportinit

Given the code already in registry2.0/portimage.tcl this will finally prevent
inconsistent state when an activation operation is interrupted. The code there
will correctly catch the error and roll back the changes made to the
filesystem.

There might be further places where MacPorts could be smarter now that is has
signal handling code, but I think this change is already a huge improvement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/macports.tcl

    r118167 r118298  
    3737package require macports_dlist 1.0
    3838package require macports_util 1.0
     39package require Tclx
    3940
    4041namespace eval macports {
     
    589590    encoding system utf-8
    590591
     592    # Set up signal handling for SIGTERM and SIGINT
     593    # Specifying error here will case the program to abort where it is with
     594    # a Tcl error, which can be caught, if necessary.
     595    signal -restart error {TERM INT}
     596
    591597    # set up platform info variables
    592598    set os_arch $tcl_platform(machine)
Note: See TracChangeset for help on using the changeset viewer.