return urlsanit($debbugs::gCGIDomain . "pkgreport.cgi" . "?" . "$params");
}
+sub srcurl {
+ my $ref = shift;
+ my $params = "src=$ref";
+ $params .= "&archive=yes" if ($common_archive);
+ $params .= "&repeatmerged=yes" if ($common_repeatmerged);
+ return urlsanit($debbugs::gCGIDomain . "pkgreport.cgi" . "?" . "$params");
+}
+
sub urlsanit {
my $url = shift;
$url =~ s/%/%25/g;
$url =~ s/\+/%2b/g;
- return $url;
+ return htmlsanit($url);
}
sub htmlsanit {
$params .= "&archive=yes" if ($common_archive);
$params .= "&repeatmerged=yes" if ($common_repeatmerged);
- return $debbugs::gCGIDomain . "bugreport.cgi" . "?" . "$params";
+ return urlsanit($debbugs::gCGIDomain . "bugreport.cgi" . "?" . "$params");
}
sub packageurl {
my $ref = shift;
- return $debbugs::gCGIDomain . "package.cgi" . "?" . "package=$ref";
+ return urlsanit($debbugs::gCGIDomain . "package.cgi" . "?" . "package=$ref");
}
sub allbugs {
my %section = ();
my %displayshowpending = ("pending", "outstanding",
+ "pending-fixed", "pending upload",
"fixed", "fixed in NMU",
"done", "resolved",
"forwarded", "forwarded to upstream software authors");
if (%common_exclude) {
my $okay = 1;
foreach my $t (split /\s+/, $status{tags}) {
- $okay = 0, last if (defined $comon_exclude{$t});
+ $okay = 0, last if (defined $common_exclude{$t});
}
if (defined $common_exclude{subj}) {
if (index($status{subject}, $common_exclude{subj}) > -1) {
my $result = "";
my $anydone = 0;
- foreach my $pending (qw(pending forwarded fixed done)) {
+ foreach my $pending (qw(pending forwarded pending-fixed fixed done)) {
foreach my $severity(@debbugs::gSeverityList) {
$severity = $debbugs::gDefaultSeverity if ($severity eq '');
next unless defined $section{${pending} . "_" . ${severity}};
$maintainer{$a}= $b;
}
close(MM);
+ open(MM,"$gMaintainerFileOverride") or &quit("open $gMaintainerFileOverride: $!");
+ while(<MM>) {
+ next unless m/^(\S+)\s+(\S.*\S)\s*$/;
+ ($a,$b)=($1,$2);
+ $a =~ y/A-Z/a-z/;
+ $maintainer{$a}= $b;
+ }
+ close(MM);
return \%maintainer;
}
+sub getpkgsrc {
+ my %pkgsrc;
+
+ open(MM,"$gPackageSource") or &quit("open $gPackageSource: $!");
+ while(<MM>) {
+ next unless m/^(\S+)\s+(\S.*\S)\s*$/;
+ ($a,$b)=($1,$2);
+ $a =~ y/A-Z/a-z/;
+ $pkgsrc{$a}= $b;
+ }
+ close(MM);
+
+ return \%pkgsrc
+}
+
+sub getbugdir {
+ my ( $bugnum, $ext ) = @_;
+ my $archdir = sprintf "%02d", $bugnum % 100;
+ foreach ( ( "$gSpoolDir/db-h/$archdir", "$gSpoolDir/db", "$gSpoolDir/archive/$archdir" ) ) {
+ return $_ if ( -r "$_/$bugnum.$ext" );
+ }
+ return undef;
+}
+
sub getbugstatus {
my $bugnum = shift;
my %status;
- unless (open(S,"$gSpoolDir/db/$bugnum.status")) {
- my $archdir = sprintf "%02d", $bugnum % 100;
- open(S,"$gSpoolDir/archive/$archdir/$bugnum.status" ) or return {};
- }
+ my $dir = getbugdir( $bugnum, "status" );
+ return {} if ( !$dir );
+ open S, "< $dir/$bugnum.status";
my @lines = qw(originator date subject msgid package tags done
forwarded mergedwith severity);
while(<S>) {
$status{"severity"} = 'normal' if ($status{"severity"} eq '');
$status{"pending"} = 'pending';
- $status{"pending"} = 'forwarded' if (length($status{"forwarded"}));
- $status{"pending"} = 'fixed' if ($status{"tags"} =~ /\bfixed\b/);
- $status{"pending"} = 'done' if (length($status{"done"}));
+ $status{"pending"} = 'forwarded' if (length($status{"forwarded"}));
+ $status{"pending"} = 'fixed' if ($status{"tags"} =~ /\bfixed\b/);
+ $status{"pending"} = 'pending-fixed' if ($status{"tags"} =~ /\bpending\b/);
+ $status{"pending"} = 'done' if (length($status{"done"}));
return \%status;
}
sub buglog {
my $bugnum = shift;
- my $res;
- $res = "$gSpoolDir/db/$bugnum.log";
- return $res if ( -e $res );
-
- my $archdir = sprintf "%02d", $bugnum % 100;
- $res = "$gSpoolDir/archive/$archdir/$bugnum.log";
- return $res if ( -e $res );
-
- return "";
+ my $dir = getbugdir( $bugnum, "log" );
+ return "" if ( !$dir );
+ return "$dir/$bugnum.log";
}
-1
+1;