]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Trap SIGINT and exit at a safe point in expire.in
authorDon Armstrong <don@donarmstrong.com>
Sat, 16 Jun 2007 21:13:23 +0000 (22:13 +0100)
committerDon Armstrong <don@donarmstrong.com>
Sat, 16 Jun 2007 21:13:23 +0000 (22:13 +0100)
scripts/expire.in

index 2fbdcb77067beb74b23e85d3577ba70d9dddd55f..f5e0a15d49106416ebd0d63188494fd614ff0ad1 100755 (executable)
@@ -33,6 +33,8 @@ foreach my $dir (@dirs) {
 
 my $bug;
 my $errors=0;
+our $exit_now = 0;
+$SIG{INT} = sub {$exit_now=1;}
 #process each bug (ie, status file)
 while (length($bug=shift(@list))) {
      # Weeeee.
@@ -44,6 +46,7 @@ while (length($bug=shift(@list))) {
          $errors=1;
          print STDERR "Unable to archive bug# $bug which I thought I could archive:\n$@\n";
      }
+     last if $exit_now;
 }
 
 exit $errors;