------------------------------------------------------------ revno: 915 committer: Debian BTS <debb...@rietz> branch nick: mainline timestamp: Mon 2010-02-08 10:40:57 +0000 message: merge changes from don source ------------------------------------------------------------ revno: 738.3.213 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-08 02:38:34 -0800 message: * create an empty pseudo-package.maint file ------------------------------------------------------------ revno: 738.3.212 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Thu 2010-02-04 23:38:18 -0800 message: * fix extraneous semicolon ------------------------------------------------------------ revno: 738.3.211 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Thu 2010-02-04 18:20:01 -0800 message: Linkify CVE reports (closes: #568464). Thanks to Martin Zobel-Helas. ------------------------------------------------------------ revno: 738.3.210 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 18:26:46 -0800 message: update changelog ------------------------------------------------------------ revno: 738.3.209 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 18:23:16 -0800 message: fix flatfile search regex to handle maintainers which contain '[' ------------------------------------------------------------ revno: 738.3.208 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 18:19:02 -0800 message: * Allow tag instead of tags; silently normalize it (closes: #567407). Thanks to Martin Krafft. * Properly handle Forwarded: at submit@ time (closes: #568020). Thanks to Martin Krafft. * Fix source package src: urls ------------------------------------------------------------ revno: 738.3.207 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 09:34:31 -0800 message: Fix affects for source packages (closes: #563470). Thanks to Charles Plessy. ------------------------------------------------------------ revno: 738.3.206 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 09:23:20 -0800 message: Fix links to PTS pages for src packages (closes: #566089). Thanks to Sandro Tosi. ------------------------------------------------------------ revno: 738.3.205 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 09:12:32 -0800 message: * Handle \r properly in Debbugs::MIME for PGP signatures (closes: #565981). Thanks to Mike Hommey * Allow type to be text as well as text/(something not html) (closes: #566068). Thanks to Mike Hommey. ------------------------------------------------------------ revno: 738.3.204 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 08:59:39 -0800 message: use cgi/pkgreport_javascript; documentation of included/excluded bugs stub ------------------------------------------------------------ revno: 738.3.203 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-02-01 08:58:22 -0800 message: * Remove unused subroutines * ditch pkg_javascript * Fix mising defined check for $status{done} ------------------------------------------------------------ revno: 738.3.202 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Tue 2010-01-26 15:25:39 -0800 message: properly handle source packages in get_versions ------------------------------------------------------------ revno: 738.3.201 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-01-18 22:03:26 -0800 message: Properly handle source packages when searching by maintainer; use package_maintainer instead of the hashes (closes: #556863) ------------------------------------------------------------ revno: 738.3.200 committer: Don Armstrong <d...@donarmstrong.com> branch nick: source timestamp: Mon 2010-01-18 22:03:17 -0800 message: make the limit transcript quote things to track down some bugs
=== modified file 'Debbugs/Bugs.pm' --- Debbugs/Bugs.pm 2009-07-21 17:58:57 +0000 +++ Debbugs/Bugs.pm 2010-02-08 10:40:54 +0000 @@ -55,7 +55,7 @@ use IO::File; use Debbugs::Status qw(splitpackages get_bug_status); use Debbugs::Packages qw(getsrcpkgs getpkgsrc); -use Debbugs::Common qw(getparsedaddrs getmaintainers getmaintainers_reverse make_list); +use Debbugs::Common qw(getparsedaddrs package_maintainer getmaintainers make_list); use Fcntl qw(O_RDONLY); use MLDBM qw(DB_File Storable); use List::Util qw(first); @@ -623,7 +623,7 @@ } my @bugs; BUG: while (<$flatfile>) { - next unless m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*([^]]*)\s*\]\s+(\w+)\s+(.*)$/; + next unless m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*(.*)\s*\]\s+(\w+)\s+(.*)$/; my ($pkg,$bug,$time,$status,$submitter,$severity,$tags) = ($1,$2,$3,$4,$5,$6,$7); next if $grep_bugs and not exists $bugs{$bug}; if (exists $param{package}) { @@ -742,10 +742,8 @@ } if (exists $param{maint}) { my $key_inc = 0; - my $maint_rev = getmaintainers_reverse(); my %_temp_p = (); - for my $package (map { exists $maint_rev->{$...@{$maint_rev->{$_}}:()} - make_list($param{maint})) { + for my $package (package_maintainer(maintainer=>$param{maint})) { $packages{$package}++ unless exists $_temp_p{$package}; $_temp_p{$package} = 1; $key_inc = 1;
=== modified file 'Debbugs/CGI.pm' --- Debbugs/CGI.pm 2009-08-10 20:45:04 +0000 +++ Debbugs/CGI.pm 2010-02-08 10:40:54 +0000 @@ -400,11 +400,15 @@ } my @links = (); for my $type (qw(src package)) { - push @links, map {(munge_url('pkgreport.cgi?', + push @links, map {my $t_type = $type; + if ($_ =~ s/^src://) { + $t_type = 'src'; + } + (munge_url('pkgreport.cgi?', %options, - $type => $_, + $t_type => $_, ), - ($type eq 'src'?'src:':'').$_); + ($t_type eq 'src'?'src:':'').$_); } make_list($param{$type}) if exists $param{$type}; } for my $type (qw(maint owner submitter correspondent)) { === modified file 'Debbugs/CGI/Bugreport.pm' --- Debbugs/CGI/Bugreport.pm 2009-08-03 16:12:00 +0000 +++ Debbugs/CGI/Bugreport.pm 2010-02-08 10:40:54 +0000 @@ -251,7 +251,13 @@ $temp =~ s{(\d+)} {bug_links(bug=>$1)}ge; $temp;]gxie; - + if (defined $config{cve_tracker} and + length $config{cve_tracker} + ) { + # Add links to CVE vulnerabilities (closes #568464) + $body =~ s{(CVE-\d{4}-\d{4,})} + {<a href="http://$config{cve_tracker}$1">$1</a>}gx; + } if (not exists $param{att}) { print {$param{output}} qq(<pre class="message">$body</pre>\n); } === modified file 'Debbugs/CGI/Pkgreport.pm' --- Debbugs/CGI/Pkgreport.pm 2009-03-05 18:57:14 +0000 +++ Debbugs/CGI/Pkgreport.pm 2010-02-08 10:40:54 +0000 @@ -51,13 +51,9 @@ @EXPORT = (); %EXPORT_TAGS = (html => [qw(short_bug_status_html pkg_htmlizebugs), - qw(pkg_javascript), - qw(pkg_htmlselectyesno pkg_htmlselectsuite), - qw(buglinklist pkg_htmlselectarch) ], - misc => [qw(generate_package_info make_order_list), - qw(myurl), - qw(get_bug_order_index determine_ordering), + misc => [qw(generate_package_info), + qw(determine_ordering), ], ); @EXPORT_OK = (qw()); @@ -78,7 +74,7 @@ spec => {binary => {type => BOOLEAN, default => 1, }, - package => {type => SCALAR|ARRAYREF, + package => {type => SCALAR,#|ARRAYREF, }, options => {type => HASHREF, }, @@ -146,6 +142,8 @@ if (defined $config{subscription_domain} and length $config{subscription_domain}) { my $ptslink = $param{binary} ? $srcforpkg : $package; + # the pts only wants the source, and doesn't care about src: (#566089) + $ptslink =~ s/^src://; push @references, q(to the <a href="http://).html_escape("$config{subscription_domain}/$ptslink").q(">Package Tracking System</a>); } # Only output this if the source listing is non-trivial. @@ -233,7 +231,7 @@ if (@blocks && $status{"pending"} ne 'fixed' && ! length($status{done})) { for my $b (@blocks) { my %s = %{get_bug_status($b)}; - next if $s{"pending"} eq 'fixed' || length $s{done}; + next if (defined $s{pending} and $s{pending} eq 'fixed') or (defined $s{done} and length $s{done}); push @{$status{blocks_array}}, {bug_num => $b, subject => $s{subject}, status => \%s}; } } @@ -457,74 +455,6 @@ return $result; } -sub pkg_javascript { - return fill_in_template(template=>'cgi/pkgreport_javascript', - ); -} - -sub pkg_htmlselectyesno { - my ($name, $n, $y, $default) = @_; - return sprintf('<select name="%s"><option value=no%s>%s</option><option value=yes%s>%s</option></select>', $name, ($default ? "" : " selected"), $n, ($default ? " selected" : ""), $y); -} - -sub pkg_htmlselectsuite { - my $id = sprintf "b_%d_%d_%d", $_[0], $_[1], $_[2]; - my @suites = ("stable", "testing", "unstable", "experimental"); - my %suiteaka = ("stable", "etch", "testing", "lenny", "unstable", "sid"); - my $defaultsuite = "unstable"; - - my $result = sprintf '<select name=dist id="%s">', $id; - for my $s (@suites) { - $result .= sprintf '<option value="%s"%s>%s%s</option>', - $s, ($defaultsuite eq $s ? " selected" : ""), - $s, (defined $suiteaka{$s} ? " (" . $suiteaka{$s} . ")" : ""); - } - $result .= '</select>'; - return $result; -} - -sub pkg_htmlselectarch { - my $id = sprintf "b_%d_%d_%d", $_[0], $_[1], $_[2]; - my @arches = qw(alpha amd64 arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc); - - my $result = sprintf '<select name=arch id="%s">', $id; - $result .= '<option value="any">any architecture</option>'; - for my $a (@arches) { - $result .= sprintf '<option value="%s">%s</option>', $a, $a; - } - $result .= '</select>'; - return $result; -} - -sub myurl { - my %param = @_; - return html_escape(pkg_url(map {exists $param{$_}?($_,$param{$_}):()} - qw(archive repeatmerged mindays maxdays), - qw(version dist arch package src tag maint submitter) - ) - ); -} - -sub make_order_list { - my $vfull = shift; - my @x = (); - - if ($vfull =~ m/^([^:]+):(.*)$/) { - my $v = $1; - for my $vv (split /,/, $2) { - push @x, "$v=$vv"; - } - } - else { - for my $v (split /,/, $vfull) { - next unless $v =~ m/.=./; - push @x, $v; - } - } - push @x, ""; # catch all - return @x; -} - sub get_bug_order_index { my $order = shift; my $status = shift; @@ -556,13 +486,6 @@ return $pos + 1; } -sub buglinklist { - my ($prefix, $infix, @els) = @_; - return '' if not @els; - return $prefix . bug_linklist($infix,'submitter',@els); -} - - # sets: my @names; my @prior; my @title; my @order; sub determine_ordering { === modified file 'Debbugs/Common.pm' --- Debbugs/Common.pm 2009-08-15 23:19:36 +0000 +++ Debbugs/Common.pm 2010-02-08 10:40:54 +0000 @@ -306,6 +306,9 @@ binary => {type => SCALAR|ARRAYREF, default => [], }, + maintainer => {type => SCALAR|ARRAYREF, + default => [], + }, rehash => {type => BOOLEAN, default => 0, }, @@ -314,6 +317,12 @@ }, }, ); + my @binary = make_list($param{binary}); + my @source = make_list($param{source}); + my @maintainers = make_list($param{maintainer}); + if ((@binary or @source) and @maintainers) { + croak "It is nonsensical to pass both maintainers and source or binary"; + } if ($param{rehash}) { $_source_maintainer = undef; $_source_maintainer_rev = undef; @@ -326,7 +335,7 @@ $_source_maintainer_rev = {}; for my $fn (@config{('source_maintainer_file', 'source_maintainer_file_override', - 'pseduo_maint_file')}) { + 'pseudo_maint_file')}) { next unless defined $fn; if (not -e $fn) { warn "Missing source maintainer file '$fn'"; @@ -342,7 +351,7 @@ $_maintainer_rev = {}; for my $fn (@config{('maintainer_file', 'maintainer_file_override', - 'pseduo_maint_file')}) { + 'pseudo_maint_file')}) { next unless defined $fn; if (not -e $fn) { warn "Missing maintainer file '$fn'"; @@ -353,19 +362,23 @@ } } my @return; - my @extra_source; - my $b = $param{reverse}?$_maintainer_rev:$_maintainer; - for my $binary (make_list($param{binary})) { + for my $binary (@binary) { if (not $param{reverse} and $binary =~ /^src:/) { - push @extra_source,$binary; + push @source,$binary; next; } - push @return,grep {defined $_} make_list($b->{$binary}); + push @return,grep {defined $_} make_list($_maintainer->{$binary}); } - my $s = $param{reverse}?$_source_maintainer_rev:$_source_maintainer; - for my $source (make_list($param{source},@extra_source)) { + for my $source (@source) { $source =~ s/^src://; - push @return,grep {defined $_} make_list($s->{$source}); + push @return,grep {defined $_} make_list($_source_maintainer->{$source}); + } + for my $maintainer (grep {defined $_} @maintainers) { + push @return,grep {defined $_} + make_list($_maintainer_rev->{$maintainer}); + push @return,map {$_ !~ /^src:/?'src:'.$_:$_} + grep {defined $_} + make_list($_source_maintainer_rev->{$maintainer}); } return @return; } === modified file 'Debbugs/Config.pm' --- Debbugs/Config.pm 2009-10-20 20:36:01 +0000 +++ Debbugs/Config.pm 2010-02-08 10:40:54 +0000 @@ -60,6 +60,7 @@ qw($gVersionPackagesDir $gVersionIndex $gBinarySourceMap $gSourceBinaryMap), qw($gVersionTimeIndex), qw($gSimpleVersioning), + qw($gCVETracker), qw($gSendmail $gLibPath $gSpamScan @gExcludeFromControl), qw(%gSeverityDisplay @gTags @gSeverityList @gStrongSeverities), qw(%gTagsSingleLetter), @@ -205,9 +206,21 @@ =cut - set_default(\%config,'subscription_domain',undef); + +=item cve_tracker $gCVETracker + +URI to CVE security tracker; in bugreport.cgi, CVE-2001-0002 becomes +linked to http://$config{cve_tracker}CVE-2001-002 + +Default: security-tracker.debian.org/tracker/ + +=cut + +set_default(\%config,'cve_tracker','security-tracker.debian.org/tracker/'); + + =back =cut @@ -1064,7 +1077,7 @@ $hash_name =~ s/^([\$...@])g//; my $glob_type = $1; my $glob_name = 'g'.$hash_name; - $hash_name =~ s/(HTML|CGI)/ucfirst(lc($1))/ge; + $hash_name =~ s/(HTML|CGI|CVE)/ucfirst(lc($1))/ge; $hash_name =~ s/^([A-Z]+)/lc($1)/e; $hash_name =~ s/([A-Z]+)/'_'.lc($1)/ge; return $hash_name unless wantarray; === modified file 'Debbugs/Control.pm' --- Debbugs/Control.pm 2010-01-02 23:37:03 +0000 +++ Debbugs/Control.pm 2010-02-08 10:40:54 +0000 @@ -2829,9 +2829,9 @@ } if (not $match) { $going_to_fail = 1; - print {$transcript} "$field: '".join(', ',make_list($data->{$field})). + print {$transcript} qq($field: ).join(', ',map{qq("$_")} make_list($data->{$field})). "' does not match at least one of ". - join(', ',map {ref($_)?'(regex)':$_} make_list($param{limit}{$field}))."\n"; + join(', ',map {ref($_)?'(regex)':qq("$_")} make_list($param{limit}{$field}))."\n"; } } } === modified file 'Debbugs/MIME.pm' --- Debbugs/MIME.pm 2009-07-21 17:59:35 +0000 +++ Debbugs/MIME.pm 2010-02-08 10:40:54 +0000 @@ -58,7 +58,7 @@ my $entity = shift; my $type = $entity->effective_type; if ($type eq 'text/plain' or - ($type =~ m#text/# and $type ne 'text/html') or + ($type =~ m#text/?# and $type ne 'text/html') or $type eq 'application/pgp') { return $entity->bodyhandle; } elsif ($type eq 'multipart/alternative') { @@ -120,7 +120,12 @@ # Strip off RFC2440-style PGP clearsigning. if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) { - shift @bodylines while @bodylines and length $bodylines[0]; + shift @bodylines while @bodylines and + length $bodylines[0] and + # we currently don't strip \r; handle this for the + # time being, though eventually it should be stripped + # too, I think. [See #565981] + $bodylines[0] ne "\r"; shift @bodylines while @bodylines and $bodylines[0] !~ /\S/; for my $findsig (0 .. $#bodylines) { if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) { === modified file 'Debbugs/Packages.pm' --- Debbugs/Packages.pm 2009-10-20 05:34:13 +0000 +++ Debbugs/Packages.pm 2010-02-08 10:40:54 +0000 @@ -444,6 +444,10 @@ } my %versions; for my $package (make_list($param{package})) { + my $source_only = 0; + if ($package =~ s/^src://) { + $source_only = 1; + } my $version = $versions->{$package}; next unless defined $version; for my $dist (make_list($param{dist})) { @@ -451,7 +455,7 @@ make_list($param{arch}): (grep {not $param{no_source_arch} or $_ ne 'source' - } keys %{$version->{$dist}})) { + } $source_only?'source':keys %{$version->{$dist}})) { next unless defined $version->{$dist}{$arch}; for my $ver (ref $version->{$dist}{$arch} ? keys %{$version->{$dist}{$arch}} : === modified file 'Debbugs/Status.pm' --- Debbugs/Status.pm 2009-09-10 15:53:41 +0000 +++ Debbugs/Status.pm 2010-02-08 10:40:54 +0000 @@ -619,7 +619,7 @@ addfoundversions($status,$package,$version,$isbinary); - +All use of this should be phased out in favor of Debbugs::Control::fixed/found =cut @@ -632,6 +632,10 @@ return unless defined $version; undef $package if $package =~ m[(?:\s|/)]; my $source = $package; + if ($package =~ s/^src://) { + $isbinary = 0; + $source = $package; + } if (defined $package and $isbinary) { my @srcinfo = binary_to_source(binary => $package, === modified file 'cgi/pkgreport.cgi' --- cgi/pkgreport.cgi 2010-01-03 09:44:08 +0000 +++ cgi/pkgreport.cgi 2010-02-08 10:40:54 +0000 @@ -77,7 +77,8 @@ } for my $incexc (qw(include exclude)) { next unless exists $param{$incexc}; - $param{$incexc} = [grep /\S\:\S/, make_list($param{$incexc})]; + # normalize tag to tags + $param{$incexc} = [map {s/^tag:/tags:/} grep /\S\:\S/, make_list($param{$incexc})]; } for my $key (keys %package_search_keys) { next unless exists $param{key}; @@ -93,6 +94,16 @@ exit 0; } +# normalize innclude/exclude keys; currently this is in two locations, +# which is suboptimal. Closes: #567407 +for my $incexc (qw(include exclude)) { + next unless exists $param{$incexc}; + # normalize tag to tags + $param{$incexc} = [map {s/^tag:/tags:/} make_list($param{$incexc})]; +} + + + # map from yes|no to 1|0 for my $key (qw(repeatmerged bug-rev pend-rev sev-rev)) { if (exists $param{$key}){ @@ -363,16 +374,20 @@ # shove in bugs which affect this package if there is a package or a # source given (by default), but no affects options given if (not exists $param{affects} and not exists $param{noaffects} and - (exists $param{source} or + (exists $param{src} or exists $param{package})) { - push @bugs, get_bugs((map {exists $param{$_}?($_ =~ /^(?:package|source)$/?'affects':$_, - ($_ eq 'source'?'src:'.$param{$_}:$param{$_})):()} + push @bugs, get_bugs((map {my $key = $_; + exists $param{$key}?($key =~ /^(?:package|src)$/?'affects':$key, + ($key eq 'src'?[map {"src:$_"}make_list($param{$key})]:$param{$_})):()} grep {$_ ne 'newest'} keys %package_search_keys, 'archive'), usertags => \%ut, ); } +# filter out included or excluded bugs + + if (defined $param{version}) { $title .= " at version $param{version}"; } @@ -467,7 +482,7 @@ print $result; -print pkg_javascript() . "\n"; +print fill_in_template(template=>'cgi/pkgreport_javascript'); print qq(<h2 class="outstanding"><!--<a class="options" href="javascript:toggle(1)">-->Options<!--</a>--></h2>\n); === modified file 'debian/changelog' --- debian/changelog 2009-09-10 15:53:41 +0000 +++ debian/changelog 2010-02-08 10:40:54 +0000 @@ -4,6 +4,24 @@ #497144) * Fix problem with non-existant /etc/debbugs/config * Ditch \r and \n in status fields (closes: #545895) + * Properly handle source packages when searching by maintainer; use + package_maintainer instead of the hashes (closes: #556863) + * Handle \r properly in Debbugs::MIME for PGP signatures + (closes: #565981). Thanks to Mike Hommey + * Allow type to be text as well as text/(something not html) + (closes: #566068). Thanks to Mike Hommey. + * Fix links to PTS pages for src packages (closes: #566089). Thanks to + Sandro Tosi. + * Fix affects for source packages (closes: #563470). Thanks to Charles + Plessy. + * Allow tag instead of tags; silently normalize it (closes: #567407). + Thanks to Martin Krafft. + * Properly handle Forwarded: at submit@ time (closes: #568020). Thanks + to Martin Krafft. + * Fix source package src: urls + * Use package_maintainer to search for packages maintained by a + maintainer (closes: #556863). Thanks to Yves-Alexis Perez. + * Linkify CVE reports (closes: #568464). Thanks to Martin Zobel-Helas. -- Don Armstrong <d...@debian.org> Wed, 26 Aug 2009 21:32:53 -0700 === modified file 'scripts/process' --- scripts/process 2009-09-10 01:54:21 +0000 +++ scripts/process 2010-02-08 10:40:54 +0000 @@ -587,7 +587,7 @@ $data->{owner}= $pheader{owner}; } if (defined($pheader{forwarded})) { - $data->{'forwarded-to'} = $pheader{forwarded}; + $data->{forwarded} = $pheader{forwarded}; } &filelock("nextnumber.lock"); open(N,"nextnumber") || die "nextnumber: read: $!"; === modified file 't/lib/DebbugsTest.pm' --- t/lib/DebbugsTest.pm 2009-08-15 23:19:48 +0000 +++ t/lib/DebbugsTest.pm 2010-02-08 10:40:54 +0000 @@ -93,6 +93,7 @@ foo main foo END "$config_dir/pseudo-packages.description" => '', + "$config_dir/pseudo-packages.maint" => '', ); while (my ($file,$contents) = each %files_to_create) { system('mkdir','-p',dirname($file));