From: ajt <> Date: Sun, 6 Jan 2002 18:46:24 +0000 (-0800) Subject: [project @ 2002-01-06 10:46:24 by ajt] X-Git-Tag: release/2.6.0~1076 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5fde57875b7b6ad01513e893ab90955b546eb156;p=debbugs.git [project @ 2002-01-06 10:46:24 by ajt] catch up with master --- diff --git a/scripts/age-1.in b/scripts/age-1.in index 19d22a6f..cc2e72da 100755 --- a/scripts/age-1.in +++ b/scripts/age-1.in @@ -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 diff --git a/scripts/errorlib.in b/scripts/errorlib.in index c7c1f113..3565cf0a 100755 --- a/scripts/errorlib.in +++ b/scripts/errorlib.in @@ -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= ); chop($s_date= ); chop($s_subject= ); @@ -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.new"); + while(my $line = ) { + @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(); + close(IDXNEW); + close(IDXDB); + rename("/org/bugs.debian.org/spool/index.db.realtime.new", + "/org/bugs.debian.org/spool/index.db.realtime"); &unfilelock; } diff --git a/scripts/expire.in b/scripts/expire.in index d85a41ab..2ea5000c 100755 --- a/scripts/expire.in +++ b/scripts/expire.in @@ -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; diff --git a/scripts/process.in b/scripts/process.in index 5e8e46ab..df163239 100755 --- a/scripts/process.in +++ b/scripts/process.in @@ -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; diff --git a/scripts/receive.in b/scripts/receive.in index e9783658..b0942949 100755 --- a/scripts/receive.in +++ b/scripts/receive.in @@ -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';