]> git.donarmstrong.com Git - debbugs.git/commitdiff
merge changes from dla source tree
authorDebian BTS <debbugs@rietz>
Tue, 19 Jun 2007 14:31:45 +0000 (14:31 +0000)
committerDebian BTS <debbugs@rietz>
Tue, 19 Jun 2007 14:31:45 +0000 (14:31 +0000)
Debbugs/Common.pm
scripts/expire.in

index 4f36cb1c5f27e05d8891e433e833124ff0860065..4ef98f62da0f84e7745a06460366584b91f1ba77 100644 (file)
@@ -367,7 +367,7 @@ sub lockpid {
          unlink $pidfile or
               die "Unable to unlink stale pidfile $pidfile $!";
      }
-     my $pidfh = IO::File->new($pidfile), 'w' or
+     my $pidfh = IO::File->new($pidfile,'w') or
          die "Unable to open $pidfile for writing: $!";
      print {$pidfh} $$ or die "Unable to write to $pidfile $!";
      close $pidfh or die "Unable to close $pidfile $!";
index 36781bcd09f92203caaccc798936ebce288a36ff..1b27dcee8afded75927b27c61d0903b0fe79d5ee 100755 (executable)
@@ -90,24 +90,26 @@ 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)
 my @bugs_to_archive = ();
-for my $bug (@list))) {
+for my $bug (@list) {
      # Weeeee.
      print "Examining $bug\n" if $verbose;
      next unless bug_archiveable(bug=>$bug);
      push @bugs_to_archive,$bug;
 }
 
+$SIG{INT} = sub {$exit_now=1;};
 # At this point we want to block control
 if (not lockpid($config{spool_dir}.'/lock/expire.pid')) {
      exit 1;
 }
 # We'll also double check that the bug can be archived
 for my $bug (@bugs_to_archive) {
+     last if $exit_now;
      print "Reexamining $bug\n" if $verbose;
      next unless bug_archiveable(bug=>$bug);
+     last if $exit_now;
      print "Bug $bug can be archived: " if $verbose;
      eval {
          bug_archive(bug=>$bug,
@@ -121,7 +123,7 @@ for my $bug (@bugs_to_archive) {
      }
      last if $exit_now;
 }
-unlink($config{spool_dir}.'/lock/expire.pid')
+unlink($config{spool_dir}.'/lock/expire.pid');
 
 
 exit $errors;