From d5a0b74a3ddd8ad47fb594e890dfd0f454627655 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 7 Mar 2007 11:38:57 +0000 Subject: [PATCH] Initial import of official branch. --- Makefile | 17 +++ bugcfg.pm | 34 +++++ bugcounts | 74 +++++++++++ bugdiff | 128 ++++++++++++++++++ bugreport | 202 ++++++++++++++++++++++++++++ bugscan | 35 +++++ cleancomments | 60 +++++++++ comments | 16 +++ crontab | 32 +++++ dograph | 37 ++++++ dohtml | 188 ++++++++++++++++++++++++++ dopost | 27 ++++ dostatus | 6 + makepost | 35 +++++ scanlib.pm | 360 ++++++++++++++++++++++++++++++++++++++++++++++++++ z | 24 ++++ 16 files changed, 1275 insertions(+) create mode 100644 Makefile create mode 100644 bugcfg.pm create mode 100755 bugcounts create mode 100755 bugdiff create mode 100755 bugreport create mode 100755 bugscan create mode 100755 cleancomments create mode 100644 comments create mode 100755 crontab create mode 100755 dograph create mode 100755 dohtml create mode 100755 dopost create mode 100755 dostatus create mode 100755 makepost create mode 100644 scanlib.pm create mode 100755 z diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ce8065f --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ + +html: + ./dohtml + +graph: + ./dograph + +post: + ./dopost + +status: + ./dostatus + +rescan: + ./crontab + +.PHONY: html graph post status rescan diff --git a/bugcfg.pm b/bugcfg.pm new file mode 100644 index 0000000..d8f1852 --- /dev/null +++ b/bugcfg.pm @@ -0,0 +1,34 @@ +#! /usr/bin/perl +# vim: ts=4 sw=4 nowrap + +# General configuration stuff + +$host=`hostname`; +chomp $host; +if ($host eq "master" or $host eq "spohr" or $host eq 'rietz') { + $spooldir = "/org/bugs.debian.org/debbugs/spool/db-h"; + $maintainerlist = "/etc/debbugs/Maintainers"; + $debian_ftproot = "/org/bugs.debian.org/etc/indices/ftp/testing"; + $nonUS_ftproot = "/org/bugs.debian.org/etc/indices/nonus/testing"; + $debian_sources = "/etc/debbugs/indices/ftp.sources"; + $nonUS_sources = "/etc/debbugs/indices/nonus.sources"; + $pseudolist = "/org/bugs.debian.org/etc/pseudo-packages.description"; + $nonuslist = "/debian/home/maor/masterfiles/Packages.non-US"; +} elsif ($host eq "lightning") { + $spooldir = "/debian/home/iwj/debian-bugs/spool/db"; + $maintainerlist = "/debian/debian/indices/Maintainers"; + $ftproot = "/debian/debian/dists/potato/"; + $pseudolist = "/debian/home/maor/masterfiles/pseudo-packages.description"; + $nonuslist = "/debian/home/maor/masterfiles/Packages.non-US"; +} else { + die "Unknown machine, please configure paths in bugcfg.pm\n"; +} + +$btsURL = "http://www.debian.org/Bugs/"; +@architectures = ( "i386", "m68k", "alpha", "sparc", "powerpc", "arm", "hppa", "ia64", "mips", "mipsel", "s390" ); +@sections = ( "main", "contrib", "non-free" ); +@priorities = ( "serious", "grave", "critical" ); +@skiptags = ( "wontfix", "fixed" ); + +1; + diff --git a/bugcounts b/bugcounts new file mode 100755 index 0000000..8792983 --- /dev/null +++ b/bugcounts @@ -0,0 +1,74 @@ +#! /usr/bin/perl +# vim: ts=4 sw=4 nowrap + +# Generate some counts for the bugreports + +use Getopt::Std; +require scanlib; +require bugcfg; + +$Version = "BugCount 1.1\nCopyright (C) Wichert Akkerman \n"; +$statusfile = "status"; +$commentsfile = "comments"; + +sub ShowVersion() { + print "$Version\n"; + exit 0; +} + +sub ShowUsage() { + print < +Options: + -V show version + -h show some (hopefully) helpfull information + -H produce HTML output + -n list newly opened bugs + -c list closed bugs + -s show statistics +EOF + exit 0; +} + +sub closedbugs() { + if ($html) { + if (%removed) { + print "

Closed/downgraded release-critical bugs

\n"; + print "
    \n"; + for $p (sort keys %removed) { + print "
  • " . &wwwname($p) . ":\n"; + for $b (sort split(/ /, $removed{$p})) { + print &wwwnumber($b) . " "; + } + print "\n"; + } + print "
\n"; + } + } else { + print "Closed/downgraded release-critical bugs:\n" if (%removed>0); + for $p (sort keys %removed) { + print " $p: "; + print join(", ", sort split(/ /, $removed{$p})); + print "\n"; + } + } +} + + +sub openedbugs() { + if ($html) { + if (%new) { + print "

Opened/upgraded release-critical bugs

\n"; + print "
    \n"; + for $p (sort keys %new) { + print "
  • " . &wwwname($p) . ":\n"; + for $b (sort split(/ /, $new{$p})) { + print &wwwnumber($b) . " "; + } + print "\n"; + } + print "
\n"; + } + } else { + print "Opened/upgraded release-critical bugs:\n" if (%new); + for $p (sort keys %new) { + print " $p: "; + print join(", ", sort split(/ /, $new{$p})); + print "\n"; + } + } +} + +sub statistics() { + if ($html) { + print "" . ($closed ? $closed : "NO") . " release-critical bugs were closed and "; + print "" . ($opened ? $opened : "NONE") . " were opened.

\n"; + } else { + print "" . ($closed ? $closed : "NO") . " release-critical bugs were closed "; + print "and " . ($opened ? $opened : "NONE") . " were opened.\n\n"; + } +} + +getopts('VhHncs'); +ShowUsage if ($opt_h or ($#ARGV != 1)); +ShowVersion if ($opt_V); +$html=1 if ($opt_H); + +&readstatus($ARGV[0]); +%oldbugs=%packagelist; +%packagelist=(); + +&readstatus($ARGV[1]); + +$closed=0; +for $p (keys %oldbugs) { + for $b (split(/ /, $oldbugs{$p})) { + if (not ($packagelist{$p} =~ m/\b$b\b/)) { + $removed{$p} .= "$b "; + $closed++; + } + } +} + +$opened=0; +for $p (keys %packagelist) { + for $b (split(/ /, $packagelist{$p})) { + if (not ($oldbugs{$p} =~ m/\b$b\b/)) { + $new{$p} .= "$b "; + $opened++; + } + } +} + +statistics if ($opt_s); +closedbugs if ($opt_c); +openedbugs if ($opt_n); + +exit 0; diff --git a/bugreport b/bugreport new file mode 100755 index 0000000..e06d3c9 --- /dev/null +++ b/bugreport @@ -0,0 +1,202 @@ +#!/usr/bin/perl +# vim: ts=4 sw=4 nowrap + +# Generate a report of the release-critical bugs for packages + +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"; +$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 + +sub ShowVersion() { + print "$Version\n"; + exit 0; +} + +sub ShowUsage() { + print <Package: " . &wwwname($p); + print " ($section{$p}).\n"; + print "Maintainer: "; + if (defined($maintainer{$p})) { + $_ = $maintainer{$p}; + ($name,$email) = m/(.*) <([^>]*)>/; + print "$name <$email>\n"; + } else { + print "unknown\n"; + } + } else { + print "\nPackage: $p ($section{$p})\n"; + print "Maintainer: " . (defined($maintainer{$p}) ? $maintainer{$p} : "unknown") . "\n"; + } +} + + +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? + + print "

\n" if ($html);
+	for $p (sort {$a cmp $b} keys %packagelist) {
+		next if (defined $exclude{$p});
+		$header = 0;
+		$fontset = 0;
+		if (defined $comments{$p}) {
+			if ($html && defined($comments{$p})) {
+				if ($comments{$p} =~ m/^\[REMOVE\]/) {
+					$fontset=1;
+					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++; + } + } + $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; + diff --git a/bugscan b/bugscan new file mode 100755 index 0000000..c6b0778 --- /dev/null +++ b/bugscan @@ -0,0 +1,35 @@ +#! /usr/bin/perl + +require bugcfg; +require scanlib; + +# Main part + +&readpackages($debian_ftproot, "debian") if defined $debian_ftproot; +&readpackages($nonUS_ftproot, "non-US") if defined $nonUS_ftproot; +&readsources($debian_ftproot, "debian") if defined $debian_ftproot; +&readsources($nonUS_ftproot, "non-US") if defined $nonUS_ftproot; + +&readdebbugssources($debian_sources, "debian") if defined $debian_sources; +&readdebbugssources($nonUS_sources, "non-US") if defined $nonUS_sources; + + +&readpseudopackages; +&readmaintainers; +&scanspool; + +for $p (keys %packagelist) { + my $section; + if (exists $section{$p}) { + $section = $section{$p}; + } else { + $section = $debbugssection{$p}; + } + print "$p $section $maintainer{$p}"; + for $b (split(/ /, $packagelist{$p})) { + print "$bugs{$b}\n"; + } +} + +exit 0; + diff --git a/cleancomments b/cleancomments new file mode 100755 index 0000000..b62e8ed --- /dev/null +++ b/cleancomments @@ -0,0 +1,60 @@ +#!/usr/bin/perl +# vim: ts=4 sw=4 nowrap + +# Read a comments-file and output only the comments that are still relevant + +use Getopt::Std; +require scanlib; +require bugcfg; + +$Version = "CommentClean 1.0\nCopyright (C) Wichert Akkerman \n"; +$html = 0; +$statusfile = "status"; +$commentfile = "comments"; + +sub ShowVersion() { + print "$Version\n"; + exit 0; +} + +sub ShowUsage() { + print < $statusfile + +rm -f status-old +if [ -f status ]; then + mv -f status status-old +fi + +ln -sf $statusfile status +./bugcounts > $countfile +ln -sf $countfile count + +./dohtml +./dostatus +./dograph diff --git a/dograph b/dograph new file mode 100755 index 0000000..182cb85 --- /dev/null +++ b/dograph @@ -0,0 +1,37 @@ +#! /bin/sh + +set -e + +cd /org/bugs.debian.org/bugscan + +tmp=`tempfile` +tmp2=`tempfile` + +find counts -type f | sort | xargs grep '^' /dev/null | + sed 's/^.*count-//;s/ .*$//;s/:/ /' >"$tmp" +find counts -type f | sort | xargs egrep '^(.* ){6}' /dev/null | + sed 's/^.*count-//;s/:.* / /;' >"$tmp2" + + +#for i in counts/count-[0-9]* ; do +# date=`echo $i | sed -e s/.*count-//` +# count=`sed -e 's/ .*//' $i` +# echo $date $count >> ${tmp}2 +#done + +cat < + + + + $title, $date + + +

$title

+ +

$date

+ +

for distribution(s): $descr

+ +
+ +

Check out Steinar H. Gunderson's beta version-tracking aware release critical bug page. + +


+ +

+EOF + ./bugreport -H -s $filter + + cat < +Explanation for comment tags: +

    +
  • [FIX]: describes a simple method to deal with + the bug. +
  • [STRATEGY]: describes a possible approach for + fixing the bug. +
  • [HELP]: help is needed to fix this bug. +
  • [REMOVE]: package will be removed if bug is not fixed +
+ +

+Explanation for bug +tags: + +

    +
  • P: pending
  • +
  • +: patch
  • +
  • H: help
  • +
  • M: moreinfo
  • +
  • R: unreproducible
  • +
  • S: security
  • +
  • U: upstream
  • +
  • I: etch-ignore
  • +
+ +

+Some bugs have an additional set of tags indicating they only apply +to a particular release: O for oldstable (woody), S for stable (sarge), +T for testing (etch), U for unstable (sid) or E for experimental. X +indicates that the package is not in testing. + +

+ +EOF + ./bugreport -H -l $filter + + cat < +This page is automatically generated.
+Please contact +owner@bugs.debian.org for comments. + + +EOF +} + +makemainpage() { + cat < + + + + $title, $time + + +

$title

+ +

$time

+ +

+EOF + + ./bugreport -Hs + + cat < + +

Graph of RC bugs
+ +

The red line graphs all bugs with release-critical severities; the green +line graphs the number of bugs that are actually a concern for the next +release (excluding ignored bugs, bugs on packages not in testing, and bugs +whose tags indicate that they don't apply to testing).

+ +

Recent changes

+EOF + + ./bugdiff -Hncs status-old status + + cat <Detailed lists of RC bug reports: + + +

+


+This page is automatically generated.
+Please contact +owner@bugs.debian.org for comments. +To receive all mails sent to release-critical bugs, subscribe to the +debian-bugs-rc +mailing list. + +EOF +} + +makepage() { + if [ ! -d "`dirname $3`" ]; then mkdir -p "`dirname $3`"; fi + realmakepage "$1" "$2" "$4" > $3.new + mv -f $3.new $3 +} + +time=$(date -u --date="1970-1-1 00:00:00 UTC + $(stat -c %Y status) secs") +oldtime=$(date -u --date="1970-1-1 00:00:00 UTC + $(stat -c %Y status-old) secs") +title="Release-critical bugs status" + + +makepage "debian" "$title" "$htmldir/debian/all.html" "$time" +makepage "debian/main" "$title" $htmldir/debian/main.html "$time" +makepage "debian/contrib" "$title" $htmldir/debian/contrib.html "$time" +makepage "debian/non-free" "$title" $htmldir/debian/non-free.html "$time" +makepage "debian/source" "$title" $htmldir/debian/source.html "$time" + +makepage "non-US" "$title" "$htmldir/debian-non-US/all.html" "$time" +makepage "non-US/main" "$title" $htmldir/debian-non-US/main.html "$time" +makepage "non-US/contrib" "$title" $htmldir/debian-non-US/contrib.html "$time" +makepage "non-US/non-free" "$title" $htmldir/debian-non-US/non-free.html "$time" +makepage "non-US/source" "$title" $htmldir/debian-non-US/source.html "$time" + +makepage "other/pseudo" "$title" $htmldir/other/pseudo.html "$time" + +makepage "" "$title" $htmldir/other/all.html "$time" + +makemainpage > $htmldir/index.html.new +mv -f $htmldir/index.html.new $htmldir/index.html + diff --git a/dopost b/dopost new file mode 100755 index 0000000..51345fa --- /dev/null +++ b/dopost @@ -0,0 +1,27 @@ +#! /bin/sh + +cd /org/bugs.debian.org/bugscan + +rm pstatus-old +mv pstatus pstatus-old +now=`ls -al status | sed -e 's/.*-\([0-9]*\)/\1/'` +ln -s stati/status-$now pstatus + +./makepost > posts/post-$now + +cat <> posts/post-$now +-- +This post is automatically generated on a regular basis. +Up-to-date information available at http://bugs.debian.org/release-critical/ +Please send comments to bugscan@debian.org +EOF + +cat posts/post-$now | \ + mutt \ + -e "my_hdr Reply-To: debian-devel@lists.debian.org,bugscan\@debian.org" \ + -e "my_hdr From: BugScan reporter " \ + -e "set send_charset='us-ascii:utf-8'" \ + -e "set charset='utf-8'" \ + -s "Release-critical Bugreport for `date +'%B %e, %Y'`" \ + debian-devel-announce@lists.debian.org + diff --git a/dostatus b/dostatus new file mode 100755 index 0000000..572dc40 --- /dev/null +++ b/dostatus @@ -0,0 +1,6 @@ +#!/bin/sh + +newtime=`ls -al status | cut -c 43-54` +echo -n "$newtime (CST): " > /org/bugs.debian.org/www/bugscan/status +./bugreport -s >> /org/bugs.debian.org/www/bugscan/status + diff --git a/makepost b/makepost new file mode 100755 index 0000000..7d9bee3 --- /dev/null +++ b/makepost @@ -0,0 +1,35 @@ +#! /bin/sh + +newtime=`ls -alL pstatus | cut -c 44-55` +oldtime=`ls -alL pstatus-old | cut -c 44-55` +title="Bug stamp-out list for $newtime (CST)" +cat <, +# which was based on an unknown other script. +# +# Global variables: +# %comments - map from bugnumber to bug description +# %premature - list of prematurely closed bugreports +# %exclude - list of bugreports to exclude from the report +# %maintainer - map from packagename to maintainer +# %section - map from packagename to section in the FTP-site +# %packagelist - map from packagename to bugreports +# %NMU - map with NMU information + +use LWP::UserAgent; +require bugcfg; + +sub readcomments() { +# Read bug commentary +# It is in paragraph format, with the first line of each paragraph being +# the bug number or package name to which the comment applies. +# Prefix a bug number with a * to force it to be listed even if it's closed. +# (This deals with prematurely closed bugs) + + local($index); # Bug-number for current comment + local($file); # Name of comments-file + + %comments = (); # Initialize our data + %premature = (); + %exclude = (); + $file=shift; + open(C, $file) or die "open $file: $!\n"; + while () { + chomp; + if (m/^\s*$/) { # Check for paragraph-breaks + undef $index; + } elsif (defined $index) { + $comments{$index} .= $_ . "\n"; + } else { + if (s/^\*//) { # Test & remove initial * + $premature{$_} = 1; + } + if (s/\s+EXCLUDE\s*//) { # Test & remove EXCLUDE + $exclude{$_} = 1; + next; + } + $index = $_; + $comments{$index} = ''; # New comment, initialize data + } + } + close(C); +} + + +# Read the list of maintainer +sub readmaintainers() { + local ($pkg); # Name of package + local ($mnt); # Maintainer name & email + + open(M, $maintainerlist) or die "open $maintainerlist: $!\n"; + while () { + chomp; + m/^(\S+)\s+(\S.*\S)\s*$/ or die "Maintainers: $_ ?"; + ($pkg, $mnt) = ($1, $2); + $pkg =~ y/A-Z/a-z/; # Normalize package-name. why??? + $_=$mnt; + if (not m/" if ( m/(\S+)\s+\(([^)]+)\)/ ); + } + $maintainer{$pkg}= $mnt; + } + close(M); +} + + +sub readsources() { + local($root); # Root of archive we are scanning + local($archive); # Name of archive we are scanning + local($sect); # Name of current section + + $root=shift; + $archive=shift; + for $sect ( @sections) { + open(P, "zcat $root/$sect/source/Sources.gz|") + or die open "open: $sect / $arch sourcelist: $!\n"; + while (

) { + chomp; + next unless m/^Package:\s/; + s/^Package:\s*//; # Strip the fieldname + $section{$_} = "$archive/$sect"; + } + close (P); + } +} + +sub readpackages() { + local($root); # Root of archive we are scanning + local($archive); # Name of archive we are scanning + local($sect); # Name of current section + local($arch); # Name of current architecture + + $root=shift; + $archive=shift; + for $arch ( @architectures ) { + for $sect ( @sections) { + open(P, "zcat $root/$sect/binary-$arch/Packages.gz|") + or die "open: $root/$sect/binary-$arch/Packages.gz: $!\n"; + while (

) { + chomp; + next unless m/^Package:\s/; # We're only interested in the packagenames + s/^Package:\s*//; # Strip the fieldname + $section{$_} = "$archive/$sect"; + } + close(P); + } + } +} + +sub readdebbugssources() { + local($file); + local($archive); + + $file=shift; + $archive=shift; + open(P, $file) + or die "open: $file: $!\n"; + while (

) { + chomp; + my ($host, $bin, $sect, $ver, $src) = split /\s+/; + my $sectname = ($sect =~ /^\Q$archive/) ? $sect : "$archive/$sect"; + $debbugssection{$bin} = $sectname; + $debbugssection{$src} = $sectname; + } + close(P); +} + +sub readpseudopackages() { + open(P, $pseudolist) or die("open $pseudolist: $!\n"); + while (

) { + chomp; + s/\s.*//; + $section{$_} = "pseudo"; + } + close(P); +} + + +sub scanspool() { + local(@dirs); + local($dir); + + chdir($spooldir) or die "chdir $spooldir: $!\n"; + + opendir(DIR, $spooldir) or die "opendir $spooldir: $!\n"; + @dirs=grep(m/^\d+$/,readdir(DIR)); + closedir(DIR); + + for $dir (@dirs) { + scanspooldir("$spooldir/$dir"); + } + +} + +sub scanspooldir() { + local($dir) = @_; + local($f); # While we're currently processing + local(@list); # List of files to process + local($s_originator, $s_date, $s_subject, $s_msgid, $s_package, $s_keywords); + local($s_done, $s_forwarded, $s_mergedwith, $s_severity); + local($skip); # Flow control + local($walk); # index variable + local($taginfo); # Tag info + + chdir($dir) or die "chdir $dir: $!\n"; + + opendir(DIR, $dir) or die "opendir $dir: $!\n"; + @list = grep { s/\.status$// } + grep { m/^\d+\.status$/ } + readdir(DIR); + closedir(DIR); + + for $f (@list) { + next if $exclude{$f}; # Check the list of bugs to skip + next if (!open(S,"$f.status")); # Check bugs without a status (?) + + chomp($s_originator = ); + chomp($s_date = ); + chomp($s_subject = ); + chomp($s_msgid = ); + chomp($s_package = ); + chomp($s_tags = ); + chomp($s_done = ); + chomp($s_forwarded = ); + chomp($s_mergedwith = ); + chomp($s_severity = ); + close(S); + + next if length($s_done) and not $premature{$f}; + $premature{$f}++ if length($s_done); + + $s_severity =~ y/A-Z/a-z/; + $s_tags =~ y/A-Z/a-z/; + + $skip=1; + for $walk (@priorities) { + $skip=0 if $walk eq $s_severity; + } + + for $tag (split(' ', $s_tags)) { + for $s (@skiptags) { + $skip=1 if $tag eq $s; + } + } + next if $skip==1; + + $relinfo = ""; + $relinfo .= ($s_tags =~ /\bwoody\b/ ? "O" : ""); + $relinfo .= ($s_tags =~ /\bsarge(|\s.*)%/ ? "S" : ""); + $relinfo .= ($s_tags =~ /\betch(|\s.*)$/ ? "T" : ""); + # etch-ignore matches \betch\b :( + $relinfo .= ($s_tags =~ /\bsid\b/ ? "U" : ""); + $relinfo .= ($s_tags =~ /\bexperimental\b/ ? "E" : ""); + + $taginfo = "["; + $taginfo .= ($s_tags =~ /\bpending\b/ ? "P" : " "); + $taginfo .= ($s_tags =~ /\bpatch\b/ ? "+" : " "); + $taginfo .= ($s_tags =~ /\bhelp\b/ ? "H" : " "); + $taginfo .= ($s_tags =~ /\bmoreinfo\b/ ? "M" : " "); + $taginfo .= ($s_tags =~ /\bunreproducible\b/ ? "R" : " "); + $taginfo .= ($s_tags =~ /\bsecurity\b/ ? "S" : " "); + $taginfo .= ($s_tags =~ /\bupstream\b/ ? "U" : " "); + $taginfo .= ($s_tags =~ /\betch-ignore\b/ ? "I" : " "); + $taginfo .= "]"; + + if ($s_mergedwith) { # Only show the first package if things are merged + my @merged = split(' ', $s_mergedwith); + next if ($merged[0] < $f); + } + + for $package (split /[,\s]+/, $s_package) { + $_= $package; y/A-Z/a-z/; $_= $` if m/[^-+._a-z0-9]/; + if (not defined $section{$_}) { + if (defined $debbugssection{$_}) { + $relinfo .= "X"; + } else { + next; # Skip unavailable packages + } + } + + $packagelist{$_} .= " $f"; + } + + if ($relinfo eq "") { # or $relinfo eq "U" # confuses e.g. #210306 + $relinfo = ""; + } else { + $relinfo = " [$relinfo]"; + } + + $bugs{$f} = "$f $taginfo$relinfo $s_subject"; + } +} + + +sub readstatus() { + local ($bug); # Number of current bug + local ($subject); # Subject for current bug + local ($pkg); # Name of current package + local ($file); # Name of statusfile + local ($sect); # Section of current package + local ($mnt); # Maintainer of current package + + $file=shift; + open(P, $file) or die "open $file: $!"; + while (

) { + chomp; + if (m/^[0-9]+ \[/) { + ($bug,$subject)=split(/ /, $_, 2); + $bugs{$bug}=$subject; + $packagelist{$pkg} .= "$bug "; + } else { + ($pkg,$sect, $mnt)=split(/ /, $_, 3); + $section{$pkg}=$sect; + $maintainer{$pkg}=$mnt; + } + } + close P; +} + + +sub readNMUstatus() { + local ($bug); # Number of current bug + local ($source); # Source upload which closes this bug. + local ($version); # Version where this bug was closed. + local ($flag); # Whether this paragraph has been processed. + local ($field, $value); + + for (split /\n/, LWP::UserAgent->new->request(HTTP::Request->new(GET => shift))->content) { + chomp; + if (m/^$/) { + $NMU{$bug} = 1; + $NMU{$bug, "source"} = $source; + $NMU{$bug, "version"} = $version; +# $comments{$bug} .= "[FIXED] Fixed package $source is in Incoming\n"; + $flag = 0; + } else { + ($field, $value) = split(/: /, $_, 2); + $bug = $value if($field =~ /bug/i); + $source = $value if($field =~ /source/i); + $version = $value if($field =~ /version/i); + $flag = 1; + } + } + if ($flag) { + $NMU{$bug} = 1; + $NMU{$bug, "source"} = $source; + $NMU{$bug, "version"} = $version; +# $comments{$bug} .= "[FIXED] Fixed package $source in in Incoming\n"; + } + close P; +} + + +sub urlsanit { + my $url = shift; + $url =~ s/%/%25/g; + $url =~ s/\+/%2b/g; + my %saniarray = ('<','lt', '>','gt', '&','amp', '"','quot'); + $url =~ s/([<>&"])/\&$saniarray{$1};/g; + return $url; +} + +sub htmlsanit { + my %saniarray = ('<','lt', '>','gt', '&','amp', '"','quot'); + my $in = shift || ""; + $in =~ s/([<>&"])/\&$saniarray{$1};/g; + return $in; +} + +sub wwwnumber() { + local ($number) = shift; # Number of bug to html-ize +# local ($section); # Section for the bug + + "' . htmlsanit($number) . ''; +# ($section=$number) =~ s/([0-9]{2}).*/$1/; +# "$number"; +} + +sub wwwname() { + local ($name) = shift; # Name of package + + "' . htmlsanit($name) . ''; +# "$name"; +} + +1; + diff --git a/z b/z new file mode 100755 index 0000000..b4d612a --- /dev/null +++ b/z @@ -0,0 +1,24 @@ +#! /bin/sh + +cd /org/bugs.debian.org/bugscan + +rm pstatus-old +mv pstatus pstatus-old +now=`ls -al status | sed -e 's/.*-\([0-9]*\)/\1/'` +ln -s stati/status-$now pstatus + +./makepost > posts/post-$now + +cat <> posts/post-$now + +This post is automatically generated. Please send comments to +bugscan@debian.org . +EOF + +cat posts/post-$now | \ + mutt \ + -e "my_hdr Reply-To: debian-devel@lists.debian.org,bugscan\@debian.org" \ + -e "my_hdr From: BugScan reporter " \ + -s "Release-critical Bugreport for `date +'%B %e, %Y'`" \ + debian-devel-announce@lists.debian.org + -- 2.39.2