]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 1999-09-14 02:08:31 by gecko]
authorgecko <>
Tue, 14 Sep 1999 09:08:31 +0000 (01:08 -0800)
committergecko <>
Tue, 14 Sep 1999 09:08:31 +0000 (01:08 -0800)
Initial bug fix... Honestly, I forgot what I've done...

scripts/config.in
scripts/expire.in
scripts/service.in

index 611133742d2c3a289db599aafc4fd79b483c740f..cd697920d57af96c9571e0195a6f846e1dc83f2a 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.2 1999/09/02 22:27:29 gecko Exp $
+# $Id: config.in,v 1.3 1999/09/14 02:08:31 gecko Exp $
 #domains
 $gEmailDomain = "bugs.benham";         #bugs.debian.org
 $gListDomain = "lists.benham";         #lists.debian.org
@@ -44,6 +44,7 @@ $gMailer='exim';                                              #valid: exim, qmail and sendmail
 $gBug='bug';
 $gBugs='bugs';
 $gRemoveAge = 28;                                              #days
+$gSaveOldBugs = 1;
 $gDefaultSeverity = 'normal';
 @gStrongSeverities= ('critical','grave');
 @gSeverityList= ('critical','grave','','wishlist');
index 5565d40df87563fe3dc5242e23b042fb8db7fa65..21b5eb68dec0550e398578a7f46a1f6ed0248597 100755 (executable)
@@ -1,66 +1,86 @@
-#!/usr/bin/perl
-# $Id: expire.in,v 1.2 1999/09/02 22:27:29 gecko Exp $
+#!/usr/bin/perl -w
+# $Id: expire.in,v 1.3 1999/09/14 02:08:31 gecko Exp $
 
+# Load modules and set envirnment
 require('/etc/debbugs/config');
 require('/usr/lib/debbugs/errorlib');
+use File::Copy;
 $ENV{'PATH'}= '/usr/lib/debbugs'.$ENV{'PATH'};
 chdir("$gSpoolDir") || die "chdir spool: $!\n";
-#push(@INC,'/usr/lib/debbugs');
-
-#open(DEBUG,">&4");
 
+#global variables
+$debug = 0;
 defined($startdate= time) || &quit("failed to get time: $!");
 
+sub get_archivename
+{      my $bugnum = shift;
+       my $archivename = "";
+
+       while( $bugnum > 99 ) { $bugnum = int $bugnum/10; }
+       $archivename = sprintf "%02d", $bugnum;
+       return $archivename;
+}
+       
+#get list of bugs (ie, status files)
 opendir(DIR,"db") || &quit("opendir db: $!\n");
 @list= grep(m/^\d+\.status$/,readdir(DIR));
 grep(s/\.status$//,@list);
 @list= sort { $a <=> $b } @list;
 
-while (length($ref=shift(@list))) {
-#print DEBUG "$ref $considering\n";
+#process each bug (ie, status file)
+while (length($ref=shift(@list))) 
+{      print STDERR "$ref $considering\n" if $debug;
     $bfound= &lockreadbugmerge($ref);
-#print DEBUG "$ref read $bfound\n";
+       print STDERR "$ref read $bfound\n" if $debug;
     $bfound || next;
-#print DEBUG "$ref read ok (done $s_done)\n";
+       print "$ref read ok (done $s_done)\n" if $debug;
     (&unlockreadbugmerge($bfound), next) unless length($s_done);
-#print DEBUG "$ref read done\n";
+       print "$ref read done\n" if $debug;
     @aref= ($ref);
     if (length($s_mergedwith)) { push(@aref,split/ /,$s_mergedwith); }
-#print DEBUG "$ref aref @aref\n";
+       print "$ref aref @aref\n" if $debug;
     $oktoremove= 1;
-    for $mref (@aref) {
-#print DEBUG "$ref $mref check\n";
-        if ($mref != $ref) {
-#print DEBUG "$ref $mref reading\n";
+    for $mref (@aref) 
+       {       print "$ref $mref check\n" if $debug;
+        if ($mref != $ref) 
+               {       print "$ref $mref reading\n" if $debug;
             &lockreadbug($mref) || die "huh ?";
-#print DEBUG "$ref $mref read ok\n";
+                       print "$ref $mref read ok\n" if $debug;
             $bfound++;
         }
-#print DEBUG "$ref $mref read/not\n";
+               print "$ref $mref read/not\n" if $debug;
         $expectmerge= join(' ',grep($_ != $mref, sort { $a <=> $b } @aref));
         $s_mergedwith eq $expectmerge ||
             die "$ref -> $mref: ($s_mergedwith) vs. ($expectmerge) (@aref)";
-#print DEBUG "$ref $mref merge-ok\n";
+               print "$ref $mref merge-ok\n" if $debug;
         length($s_done) || die "$ref -> $mref";
-#print DEBUG "$ref $mref done-ok\n";
+               print "$ref $mref done-ok\n" if $debug;
         $days= -M "db/$mref.log";
-#print DEBUG "$ref $mref days $days\n";
-        if ($days <= $gRemoveAge) {
-#print DEBUG "$ref $mref saved\n";
-            $oktoremove= 0;
-        }
+               print "ref $mref days $days\n" if $debug;
+        if ($days <= $gRemoveAge) 
+                       { print "$ref $mref saved\n" if $debug; $oktoremove= 0;}
     }
-    if ($oktoremove) {
-#print DEBUG "$ref removing\n";
-        for $mref (@aref) {
-#print DEBUG "$ref removing $mref\n";
+    if ($oktoremove) 
+       {       print "$ref removing\n" if $debug;
+        for $mref (@aref) 
+               {       print "$ref removing $mref\n" if $debug;
+                       if ( $gSaveOldBugs )
+                       {
+                               my $dir;
+                               $dir = "archive/" . get_archivename $mref;
+                               `mkdir -p "$dir"`;
+                               print( "archiving $mref (from $ref)\n" );
+                               copy( "db/$mref.log", "$dir/$mref.log" );
+                               copy( "db/$mref.status", "$dir/$mref.status" );
+                               copy( "db/$mref.report", "$dir/$mref.report" );
+                       }
             unlink("db/$mref.log", "db/$mref.status", "db/$mref.report");
             print("deleted $mref (from $ref)\n") || &quit("output old: $!");
         }
     }
-#print DEBUG "$ref unlocking $bfound\n";
+       print "$ref unlocking $bfound\n" if $debug;
     for ($i=0; $i<$bfound; $i++) { &unfilelock; }
-#print DEBUG "$ref unlocking done\n";
+       print "$ref unlocking done\n" if $debug;
 }
 
 close(STDOUT) || &quit("close stdout: $!");
index 0316c78a754e48dff4d0e6c9ca76de4c6d8069e4..4a82a51c55e4bd7614ed3615919a6b42cc1c587a 100755 (executable)
@@ -1,5 +1,5 @@
-#!/usr/bin/perl
-# $Id: service.in,v 1.2 1999/09/02 22:27:29 gecko Exp $
+#!/usr/bin/perl -w
+# $Id: service.in,v 1.3 1999/09/14 02:08:31 gecko Exp $
 #
 # Usage: service <code>.nn
 # Temps:  incoming/P<code>.nn
@@ -70,6 +70,7 @@ $state= 'idle';
 $lowstate= 'idle';
 $mergelowstate= 'idle';
 $midix=0;    
+$extras="";
 
 for ($procline=$i; $procline<=$#msg; $procline++) {
     $state eq 'idle' || "$state ?";
@@ -233,7 +234,7 @@ $replyto.
 
 You should be hearing from them with a substantive response shortly,
 if you have not already done so.  If not, please contact them
-directly, or email DB_SUBMIT_ADDRPQ or myself.
+directly or myself.
 
 $gMaintainer
 (administrator, $gProject $gBugs database)
@@ -776,7 +777,7 @@ sub addccaddress {
 sub addmaintainers {
     # Data structure is:
     #   maintainer email address &c -> assoc of packages -> assoc of bug#'s
-    my $p, $addmaint, $pshow;
+    my ($p, $addmaint, $pshow);
     &ensuremaintainersloaded;
     $anymaintfound=0; $anymaintnotfound=0;
     for $p (split(m/[ \t?,()]+/,$_[0])) {
@@ -794,7 +795,7 @@ print DEBUG "maintainer none >$p<\n";
 }
 
 sub ensuremaintainersloaded {
-    my $a,$b;
+    my ($a,$b);
     return if $maintainersloaded++;
     open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
     while (<MAINT>) {