diff options
author | Norbert Preining <preining@logic.at> | 2022-03-05 05:40:17 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2022-03-05 05:40:17 +0000 |
commit | 5f2a9e062f5b059dde19a469f2043d5fcb47eea8 (patch) | |
tree | 7bd33ba8c3852ccae5815eda2b06271d87586398 | |
parent | 98c1b86e2e2c19a50736c4d8ab61f4a1a4023548 (diff) |
install-tl: catch SIGINT and die
git-svn-id: svn://tug.org/texlive/trunk@62427 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/install-tl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Master/install-tl b/Master/install-tl index 493bcf8d377..8bb09cc162a 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -324,6 +324,12 @@ $::debug_translation = 0; # List of packages that failed to install but we continued due to --continue @::installation_failed_packages = (); +# +# set up signal handlers to catch SIGINT and SIGTERM +$SIG{INT} = &signal_handler; +# not necessary AFA we know +# $SIG{TERM} = &signal_handler; + # before we try to interact with the user, we need to know whether or not # install-tl was called from an external gui. This gui will start install-tl # with "-from_ext_gui" as its first command-line option. @@ -2530,6 +2536,12 @@ sub update_numbers { } } # update_numbers +# signal handler for interrupts SIGINT AND SIGTERM +sub signal_handler { + flushlog(); + die "Installation interrupted $!"; +} + # to be called at exit when the installation did not complete sub flushlog { if (!defined($::LOGFILENAME)) { |