X-Git-Url: https://git.donarmstrong.com/?p=bugscan.git;a=blobdiff_plain;f=bugreport;h=f9654bbd03aefb2e94070aa96737de20ac731c18;hp=e06d3c989e8d3c46d37379850430cd3f0c4446c2;hb=6cc0aae01abb47bb8732c9b07a889e8697a0169e;hpb=d5a0b74a3ddd8ad47fb594e890dfd0f454627655 diff --git a/bugreport b/bugreport index e06d3c9..f9654bb 100755 --- a/bugreport +++ b/bugreport @@ -6,12 +6,14 @@ use Getopt::Std; require scanlib; require bugcfg; - -$Version = "BugReport 1.4\nCopyright (C) 1998-2002 Wichert Akkerman \n"; -$html = 0; -$statusfile = "status"; -$commentsfile = "comments"; -$NMUfile = "/debian/home/doogie/public_html/incoming/bugs_closed"; +use strict; +use warnings; + +my $Version = "BugReport 1.4\nCopyright (C) 1998-2002 Wichert Akkerman \n"; +my $html = 0; +my $statusfile = "status"; +my $commentsfile = "comments"; +my $NMUfile = "/debian/home/doogie/public_html/incoming/bugs_closed"; $NMUfile = "/debian/home/doogie/chgscan/db/bugs_closed"; # Changed as of request by dark -Joey, 99/11/22 $NMUfile = "http://auric.debian.org/~doogie/incoming/bugs_closed"; # Changed as of request by dark -Joey, 99/11/22 @@ -23,13 +25,14 @@ sub ShowVersion() { sub ShowUsage() { print <Package: " . &wwwname($p); - print " ($section{$p}).\n"; + print "
";
+		print "Package: " . scanlib::wwwname($p);
+		print " ($scanlib::section{$p}).\n";
 		print "Maintainer: ";
-		if (defined($maintainer{$p})) {
-			$_ = $maintainer{$p};
-			($name,$email) = m/(.*) <([^>]*)>/;
+		if (defined($scanlib::maintainer{$p})) {
+			if ($scanlib::maintainer{$p} =~ /(.*) <([^>]*)>/) {
+				($name,$email) = ($1,$2);
+			} elsif ($scanlib::maintainer{$p} =~ /<(.*) \((.*)\)>/) {
+				($name,$email) = ($1,$2);
+			} elsif ($scanlib::maintainer{$p} =~ /<(.*)>/) {
+				$name = $email = $1;
+			}
 			print "$name <$email>\n";
 		} else {
 			print "unknown\n";
 		}
 	} else {
-		print "\nPackage: $p ($section{$p})\n";
-		print "Maintainer: " . (defined($maintainer{$p}) ? $maintainer{$p} : "unknown") . "\n";
+		print "\nPackage: $p ($scanlib::section{$p})\n";
+		print "Maintainer: " . (defined($scanlib::maintainer{$p}) ? $scanlib::maintainer{$p} : "unknown") . "\n";
 	}
 }
 
+sub PrintPackageFooter() {
+	my $p	= shift;	# Package to print
 
-sub MakeBuglist() {
-	local ($p);				# Index variable
-	local ($nr);			# Current bugnumber
-	local ($sect);			# BTS-subsection for bugnumber
-	local ($header);		# Flag if packagename has already been printed
-	local ($fontset);		# Did we change the font?
+	if ($html) {
+		print "
\n"; + } +} - print "
\n" if ($html);
-	for $p (sort {$a cmp $b} keys %packagelist) {
-		next if (defined $exclude{$p});
+sub MakeBuglist() {
+	my $p;				# Index variable
+	my $nr;			# Current bugnumber
+	my $sect;			# BTS-subsection for bugnumber
+	my $header;		# Flag if packagename has already been printed
+	my $fontset;		# Did we change the font?
+
+	for my $p (sort {$a->[0] <=> $b->[0]} keys %scanlib::packagelist) {
+		next if (defined $bugcfg::exclude{$p});
 		$header = 0;
 		$fontset = 0;
-		if (defined $comments{$p}) {
-			if ($html && defined($comments{$p})) {
-				if ($comments{$p} =~ m/^\[REMOVE\]/) {
+		if (defined $scanlib::comments{$p}) {
+			if ($html && defined($scanlib::comments{$p})) {
+				if ($scanlib::comments{$p} =~ m/^\[REMOVE\]/) {
 					$fontset=1;
-					print "";
+					print "";
 				}
 			}
 			$header=1;
 			&PrintPackageHeader($p);
-			print $comments{$p};
-		}
-		for $nr (sort split(/ /, $packagelist{$p})) {
-			next if (defined $exclude{$nr});
-			if (! $header) {
-				$header = 1;
-				&PrintPackageHeader($p);
-			}
-
-			if ($html) {
-				if ($bugs{$nr} =~ m/ \[[^]]*X/) {
-					print '';
-				} elsif ($bugs{$nr} =~ m/^\[[^]]*P/) {
-					print '';
-				} elsif ($bugs{$nr} =~ m/^\[[^]]*\+/) {
-					print '';
-				} elsif ($bugs{$nr} =~ m/^\[[^]]*H/) {
-					print '';
-				}
-				print "" if ($bugs{$nr} =~ m/^\[.......I\]/);
-				($sect=$nr) =~ s/([0-9]{2}).*/$1/;
-				print "  " . &wwwnumber($nr) . ' ' .
-					  htmlsanit($bugs{$nr}) . "\n";
-				print "" if ($bugs{$nr} =~ m/^\[.......I\]/);
-			} else {
-				printf("  %-6d %s\n", $nr, $bugs{$nr});
-			}
-			print $comments{$nr} if (defined($comments{$nr}));
-			print "[FIX] Fixed by package " . $NMU{$nr, "source"} . ", version " . $NMU{$nr, "version"} . " in Incoming\n" if (defined $NMU{$nr});
-			print "" if ($html && ($bugs{$nr} =~ m/^\[[^]]*[H+P]/ ||
-			                              $bugs{$nr} =~ m/ \[[^]]*X/));
-		}
-		print "" if ($fontset);
-	}
-	print "
\n" if ($html); -} - - -sub MakeStatistics() { - local($bugcount); # Total number of bugs so far - local($count); # Number of bugs for this package - local($remtotal); # Total number of bugs for packages marked REMOVE - local($patchtotal); # Total number of bugs marked patch - local($pendingtotal); # Total number of bugs marked pending - local($ignoretotal); # Total number of bugs marked ignore - local($nottestingtotal); # Total number of bugs on packages not in testing - local($worrytotal); # Total number of bugs we're actually worried about - local($p); # Index variable - local(%list); # List of bugnumber associated with package - - $bugcount=0; - for $p (sort keys %packagelist) { - next if (defined $exclude{$p}); - $count=0; - for $nr (split(/ /, $packagelist{$p})) { - $pendingtotal++ if ($bugs{$nr} =~ m/^\[[^]]*P/); - $patchtotal++ if ($bugs{$nr} =~ m/^\[[^]]*\+/); - $ignoretotal++ if ($bugs{$nr} =~ m/^\[[^]]*I/); - $nottestingtotal++ if ($bugs{$nr} =~ m/ \[[^]]*X/); - $worrytotal++ unless ( - $bugs{$nr} =~ m/^\[[^]]*I/ or - $bugs{$nr} =~ m/ \[[^]]*X/ or - ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/)); - - if (not defined($exclude{$nr})) { - $bugcount++; - $count++; - } + print $scanlib::comments{$p}; } - $remtotal+=$count if (defined($comments{$p}) && $comments{$p} =~ m/^\[REMOVE\]/); - } - - if ($html) { - print "Total number of release-critical bugs: $bugcount
\n"; - printf("Number that will disappear after removing packages marked [REMOVE]: %d
\n", $remtotal); - printf("Number that have a patch: %d
\n", $patchtotal); - printf("Number that have a fix prepared and waiting to upload: %d
\n", $pendingtotal); - printf("Number that are being ignored: %d
\n", $ignoretotal); - printf("Number on packages not in testing: %d
\n", $nottestingtotal); - printf("Number concerning the next release (excluding ignored and not-in-testing): %d

\n", $worrytotal); - } else { - print "Total number of release-critical bugs: $bugcount\n"; - printf("Number that will disappear after removing packages marked [REMOVE]: %d\n", $remtotal); - printf("Number that have a patch: %d\n", $patchtotal); - printf("Number that have a fix prepared and waiting to upload: %d\n", $pendingtotal); - printf("Number that are being ignored: %d\n", $ignoretotal); - printf("Number on packages not in testing: %d\n", $nottestingtotal); - printf("Number concerning the next release (excluding ignored and not-in-testing): %d\n", $worrytotal); - } -} - - -sub FilterPackages() { - local($filter) = shift; # Distribution we want to keep - - for $p (sort keys %packagelist) { - delete $packagelist{$p} unless ($section{$p} =~ m/^$filter/); - } -} - -getopts('VhHlsd:S:C:'); -ShowUsage if ($opt_h); -ShowVersion if ($opt_V); -$statusfile=$opt_S if ($opt_S); -$commentsfile=$opt_C if ($opt_C); -$html=1 if ($opt_H); - -&readstatus($statusfile); -&readcomments($commentsfile); -&readNMUstatus($NMUfile); - -&FilterPackages($opt_d) if ($opt_d); - -MakeStatistics if ($opt_s); -if ($opt_l) { - MakeBuglist -} - -exit 0; -