]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2002-01-06 10:46:24 by ajt]
authorajt <>
Sun, 6 Jan 2002 18:46:24 +0000 (10:46 -0800)
committerajt <>
Sun, 6 Jan 2002 18:46:24 +0000 (10:46 -0800)
catch up with master

scripts/age-1.in
scripts/errorlib.in
scripts/expire.in
scripts/process.in
scripts/receive.in

index 19d22a6f11ed1ca037d9b925397fba5c773698c5..cc2e72da1dd91618a41553ae1477470a3c76c2b0 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
-# $Id: age-1.in,v 1.2 1999/09/02 22:27:29 gecko Exp $
+# $Id: age-1.in,v 1.3 2002/01/06 10:46:24 ajt Exp $
 set -e
-cd /var/lib/debbugs/spool
+cd /var/lib/debbugs/spool/db-h
 test -f ./-3.log && rm ./-3.log
 test -f ./-2.log && mv ./-2.log ./-3.log
 test -f ./-1.log && mv ./-1.log ./-2.log
-rm -f ../stamp.html
+#rm -f ../stamp.html
index c7c1f11365ea672e2f92a8daef511975d0c2fbc7..3565cf0a1b54955e5a9e6fa22a6e8cd15542c677 100755 (executable)
@@ -1,5 +1,5 @@
 # -*- perl -*-
-# $Id: errorlib.in,v 1.5 2001/08/19 02:09:18 doogie Exp $
+# $Id: errorlib.in,v 1.6 2002/01/06 10:46:24 ajt Exp $
 
 sub F_SETLK { 6; } sub F_WRLCK{ 1; }
 $flockstruct= 'sslll'; # And there ought to be something for this too.
@@ -28,7 +28,7 @@ sub lockreadbugmerge {
 sub lockreadbug {
     local ($lref) = @_;
     &filelock("lock/$lref");
-    if (!open(S,"db-h/".get_hashname($lref)."/$lref.status")) { &unfilelock; return 0; }
+    if (!open(S,"db/$lref.status")) { &unfilelock; return 0; }
     chop($s_originator= <S>);
     chop($s_date= <S>);
     chop($s_subject= <S>);
@@ -106,6 +106,37 @@ sub bughook {
        my ( $type, $ref ) = ( shift, shift );
        &filelock("debbugs.trace.lock");
        &appendfile("debbugs.trace","$type $ref\n",@_);
+       my @stuff=split/\n/, "$_[0]\n\n\n\n\n\n\n";
+       # XXX: bug: this'll only keep the most recent update until index.db
+       #      starts getting overwritten by index.db.realtime after update
+       my $hash = get_hashname($ref);
+       unlink("$gSpoolDir/db/$ref.status.new");
+       link("$gSpoolDir/db-h/$hash/$ref.status", "$gSpoolDir/db/$ref.status.new");
+       rename("$gSpoolDir/db/$ref.status.new", "$gSpoolDir/db/$ref.status");
+       open(IDXDB, "</org/bugs.debian.org/spool/index.db.realtime")
+               or open(IDXDB, "</org/bugs.debian.org/spool/index.db");
+       open(IDXNEW, ">/org/bugs.debian.org/spool/index.db.realtime.new");
+       while(my $line = <IDXDB>) {
+               @line = split /\s/, $line;
+               last if ($line[1] == $ref);
+               print IDXNEW $line;
+       }
+       my $firstpkg;
+       my $whendone = "open";
+       my $severity = $gDefaultSeverity;
+       ($firstpkg = $stuff[4]) =~ s/[,\s].*$//;
+       $whendone = "forwarded" if length $stuff[7];
+       $whendone = "done" if length $stuff[6];
+       $severity = $stuff[9] if length $stuff[9];
+
+       printf IDXNEW "%s %d %d %s [%s] %s %s\n",
+                       $firstpkg, $ref, $stuff[1], $whendone, $stuff[0],
+                       $severity, $stuff[5];
+       print IDXNEW while(<IDXDB>);
+       close(IDXNEW);
+       close(IDXDB);
+       rename("/org/bugs.debian.org/spool/index.db.realtime.new",
+               "/org/bugs.debian.org/spool/index.db.realtime");
        &unfilelock;
 }
 
index d85a41ab120581f324b9c4d114caf1c45167449e..2ea5000c91d7354ff71e6b3984e8e8aac817ea37 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: expire.in,v 1.9 2001/08/19 06:36:43 doogie Exp $
+# $Id: expire.in,v 1.10 2002/01/06 10:46:24 ajt Exp $
 
 # Load modules and set envirnment
 use File::Copy;
@@ -28,8 +28,8 @@ foreach my $dir (@dirs) {
 }
 
 #process each bug (ie, status file)
-while (length($ref=shift(@list))) 
-{      print STDERR "$ref considering\n" if $debug;
+while (length($ref=shift(@list))) {
+       print STDERR "$ref considering\n" if $debug;
     $bfound= &lockreadbugmerge($ref);
        print STDERR "$ref read $bfound\n" if $debug;
     $bfound || next;
@@ -40,15 +40,15 @@ while (length($ref=shift(@list)))
     if (length($s_mergedwith)) { push(@aref,split/ /,$s_mergedwith); }
        print "$ref aref @aref\n" if $debug;
     $oktoremove= 1;
-    for $mref (@aref) 
-       {       print "$ref $mref check\n" if $debug;
-        if ($mref != $ref) 
-               {       print "$ref $mref reading\n" if $debug;
+    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 "$ref $mref read ok\n" if $debug;
+               print "$ref $mref read ok\n" if $debug;
             $bfound++;
         }
-               print "$ref $mref read/not\n" if $debug;
+       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)";
@@ -58,28 +58,31 @@ while (length($ref=shift(@list)))
         $days= -M "db-h/".get_hashname($mref)."/$mref.log";
                print "ref $mref days $days\n" if $debug;
         if ($days <= $gRemoveAge) 
-                       { print "$ref $mref saved\n" if $debug; $oktoremove= 0;}
+               { print "$ref $mref saved\n" if $debug; $oktoremove= 0; }
     }
-    if ($oktoremove) 
-       {       print "$ref removing\n" if $debug;
-        for $mref (@aref) 
-               {       print "$ref removing $mref\n" if $debug;
-                       my $dir = get_hashname($mref);
-                       if ( $gSaveOldBugs )
-                       {
-                               `mkdir -p "archive/$dir"`;
-                               copy( "db-h/$dir/$mref.log", "archive/$dir/$mref.log" );
-                               copy( "db-h/$dir/$mref.status", "archive/$dir/$mref.status" );
-                               copy( "db-h/$dir/$mref.report", "archive/$dir/$mref.report" );
-                               if ( open( IDXFILE, ">>archive/index" ) )
-                               {       printf IDXFILE "%s %d %s\n", $s_package, $mref, $s_subject;
-                                       close IDXFILE;
-                               } else { print "Unable to write to index file\n"; }
+    if ($oktoremove) {
+       print "$ref removing\n" if $debug;
+        for $mref (@aref) {
+               print "$ref removing $mref\n" if $debug;
+               my $dir = get_hashname($mref);
+               if ( $gSaveOldBugs ) {
+                       `mkdir -p "archive/$dir"`;
+                       link( "db-h/$dir/$mref.log", "archive/$dir/$mref.log" ) || copy( "db-h/$dir/$mref.log", "archive/$dir/$mref.log" );
+                       link( "db-h/$dir/$mref.status", "archive/$dir/$mref.status" ) || copy( "db-h/$dir/$mref.status", "archive/$dir/$mref.status" );
+                       link( "db-h/$dir/$mref.report", "archive/$dir/$mref.report" ) || copy( "db-h/$dir/$mref.report", "archive/$dir/$mref.report" );
+                       if ( open( IDXFILE, ">>archive/index" ) ) {
+                               printf IDXFILE "%s %d %s\n", $s_package, $mref, $s_subject;
+                               close IDXFILE;
+                       } else { print "Unable to write to index file\n"; }
                                
-               print("archived $mref to archive/$dir (from $ref)\n") || &quit("output old: $!");
-                       }
-            unlink("db-h/$dir/$mref.log", "db-h/$dir/$mref.status", "db-h/$dir/$mref.report");
-            print("deleted $mref (from $ref)\n") || &quit("output old: $!");
+                       print("archived $mref to archive/$dir (from $ref)\n") || &quit("output old: $!");
+               }
+               unlink("db/$mref.log", "db/$mref.status", "db/$mref.report");
+               unlink("db-h/$dir/$mref.log", "db-h/$dir/$mref.status", "db-h/$dir/$mref.report");
+               print("deleted $mref (from $ref)\n") || &quit("output old: $!");
+               &filelock("debbugs.trace.lock");
+               &appendfile("debbugs.trace","archive $mref\n");
+               &unfilelock;
         }
     }
        print "$ref unlocking $bfound\n" if $debug;
index 5e8e46ab83c9f54131db9a7710493871f7b13c7d..df16323912d6a05d936278ff3532b403914d8df3 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: process.in,v 1.41 2001/11/22 03:04:10 doogie Exp $
+# $Id: process.in,v 1.42 2002/01/06 10:46:24 ajt Exp $
 #
 # Usage: process nn
 # Temps:  incoming/Pnn
@@ -491,6 +491,9 @@ END
                "$s_package\n$s_keywords\n\n\n\n$s_severity\n");
     &overwrite("db-h/$hash/$ref.report",
                join("\n",@msg)."\n");
+    link("db-h/$hash/$ref.log", "db/$ref.log");
+    link("db-h/$hash/$ref.status", "db/$ref.status");
+    link("db-h/$hash/$ref.report", "db/$ref.report");
 }
 
 &checkmaintainers;
index e978365888ae2d24dca8af2f196aaed24066370c..b0942949d18a4eeaf94392f3cd72dabbeef601a1 100755 (executable)
@@ -1,9 +1,9 @@
-#!/usr/bin/perl -w
-# $Id: receive.in,v 1.11 2001/08/18 01:32:28 doogie Exp $
+#!/usr/bin/perl
+# $Id: receive.in,v 1.12 2002/01/06 10:46:24 ajt Exp $
 # usage: mail is piped directly into program
 
 #set umask in order to have group-writable incoming/*
-#umask 002;
+#umask(002);
 
 #load configuration file
 $config_path = '/org/bugs.debian.org/etc';