=item source -- returns source/version instead of just versions
+=item no_source_arch -- discards the source architecture when arch is
+not passed. [Used for finding the versions of binary packages only.]
+Defaults to 0, which does not discard the source architecture. (This
+may change in the future, so if you care, please code accordingly.)
+
=back
=cut
source => {type => BOOLEAN,
default => 0,
},
+ no_source_arch => {type => BOOLEAN,
+ default => 0,
+ },
},
);
my $versions;
for my $dist (make_list($param{dist})) {
for my $arch (exists $param{arch}?
make_list($param{arch}):
- (keys %{$version->{$dist}})) {
+ (grep {not $param{no_source_arch} or
+ $_ ne 'source'
+ } keys %{$version->{$dist}})) {
next unless defined $version->{$dist}{$arch};
for my $ver (ref $version->{$dist}{$arch} ?
keys %{$version->{$dist}{$arch}} :
our $CURRENT_VERSION = 1;
-our %DEBBUGS_SOAP_COOKIES;
-
=head2 get_usertag
=head2 get_status
my @statuses = get_status(@bugs);
+ my @statuses = get_status([bug => 304234,
+ dist => 'unstable',
+ ],
+ [bug => 304233,
+ dist => 'unstable',
+ ],
+ )
Returns an arrayref of hashrefs which output the status for specific
sets of bugs.
+In the first case, no options are passed to
+L<Debbugs::Status::get_bug_status> besides the bug number; in the
+second the bug, dist, arch, bugusertags, sourceversions, and version
+parameters are passed if they are present.
+
See L<Debbugs::Status::get_bug_status> for details.
=cut
sub get_status {
my $VERSION = __populate_version(pop);
my ($self,@bugs) = @_;
- @bugs = make_list(@bugs);
my %status;
for my $bug (@bugs) {
- my $bug_status = get_bug_status(bug => $bug);
+ my $bug_status;
+ if (ref($bug)) {
+ my %param = __collapse_params(@{$bug});
+ $bug_status = get_bug_status(map {(exists $param{$_})?($_,$param{$_}):()}
+ qw(bug dist arch bugusertags sourceversions version)
+ );
+ }
+ else {
+ $bug_status = get_bug_status(bug => $bug);
+ }
if (defined $bug_status and keys %{$bug_status} > 0) {
$status{$bug} = $bug_status;
}
if (@params == 1 and ref($params[0]) eq 'ARRAY') {
@params = @{$params[0]};
}
- my %params;
- # Because some clients can't handle passing arrayrefs, we allow
- # options to be specified multiple times
- while (my ($key,$value) = splice @params,0,2) {
- push @{$params{$key}}, make_list($value);
- }
- # However, for singly specified options, we want to pull them
- # back out
- for my $key (keys %params) {
- if (@{$params{$key}} == 1) {
- ($params{$key}) = @{$params{$key}}
- }
- }
+ my %params = __collapse_params(@params);
my @bugs;
@bugs = Debbugs::Bugs::get_bugs(%params);
return \@bugs;
sub newest_bugs{
my $VERSION = __populate_version(pop);
my ($self,$num) = @_;
- my $newest_bug = Debbugs::bugs::newest_bug();
+ my $newest_bug = Debbugs::Bugs::newest_bug();
return [($newest_bug - $num + 1) .. $newest_bug];
}
return $request->{___debbugs_soap_version};
}
+sub __collapse_params{
+ my @params = @_;
+
+ my %params;
+ # Because some clients can't handle passing arrayrefs, we allow
+ # options to be specified multiple times
+ while (my ($key,$value) = splice @params,0,2) {
+ push @{$params{$key}}, make_list($value);
+ }
+ # However, for singly specified options, we want to pull them
+ # back out
+ for my $key (keys %params) {
+ if (@{$params{$key}} == 1) {
+ ($params{$key}) = @{$params{$key}}
+ }
+ }
+ return %params;
+}
+
+
1;
}
if (length($status{forwarded})) {
- push @descstates, "<strong>Forwarded</strong> to ".maybelink($status{forwarded});
+ my $forward_link = $status{forwarded};
+ $forward_link =~ s,((ftp|http|https)://[\S~-]+?/?)((\>\;)?[)]?[']?[:.\,]?(\s|$)),<a href=\"$1\">$1</a>$3,go;
+ push @descstates, "<strong>Forwarded</strong> to $forward_link";
}
{
if (allDivs[i].className == "infmessage")
{
- allDivs[i].style.display=(allDivs[i].style.display == 'none') ? 'block' : 'none';
+ allDivs[i].style.display=(allDivs[i].style.display == 'none' | allDivs[i].style.display == '') ? 'block' : 'none';
+ break;
}
}
}
(exists $param{dist}?(dist => $param{dist}):()),
(exists $param{arch}?(arch => $param{arch}):()),
($key eq 'src'?(arch => q(source)):()),
+ no_source_arch => 1,
);
my $verdesc = join(', ',@versions);
$verdesc = 'version'.(@versions>1?'s ':' ').$verdesc;
sub output_package_info{
my ($srcorbin,$package) = @_;
+
+ my %pkgsrc = %{getpkgsrc()};
+ my $srcforpkg = $package;
+ if ($srcorbin eq 'binary') {
+ $srcforpkg = $pkgsrc{$package};
+ defined $srcforpkg or $srcforpkg = $package;
+ }
+
my $showpkg = html_escape($package);
my $maintainers = getmaintainers();
- my $maint = $maintainers->{$package};
+ my $maint = $maintainers->{$srcforpkg};
if (defined $maint) {
print '<p>';
print htmlize_maintlinks(sub { $_[0] == 1 ? "Maintainer for $showpkg is "
} else {
print "<p>No maintainer for $showpkg. Please do not report new bugs against this package.</p>\n";
}
- my %pkgsrc = %{getpkgsrc()};
- my $srcforpkg = $package;
- if ($srcorbin eq 'binary') {
- $srcforpkg = $pkgsrc{$package};
- defined $srcforpkg or $srcforpkg = $package;
- }
my @pkgs = getsrcpkgs($srcforpkg);
@pkgs = grep( !/^\Q$package\E$/, @pkgs );
if ( @pkgs ) {
- Allow selecting the newest N bugs (closes: #84681)
- Add anchor links to specific messages (closes: #431450)
- Add missing newline after indicating what the user is (closes: #432466)
+ - Handle src/binary packages with the same name (but different src
+ packages) correctly. (closes: #435926)
+ - Make sendmail binary location configurable, and use flock instead of
+ fcntl. (closes: #260791)
+ - Make notfound/notfixed log verbiage more clear (closes: #434953)
+ - Verify submitter is a valid email according to RFC822
+ (closes: #182419)
-- Colin Watson <cjwatson@debian.org> Fri, 20 Jun 2003 18:57:25 +0100
Maintainer: Debbugs developers <debian-debbugs@lists.debian.org>
Uploaders: Josip Rodin <joy-packages@debian.org>, Colin Watson <cjwatson@debian.org>, Don Armstrong <don@debian.org>
Standards-Version: 3.2.1
-Build-Depends-Indep: debhelper, libparams-validate-perl, libmailtools-perl, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libhttp-server-simple-perl, libtest-www-mechanize-perl
+Build-Depends-Indep: debhelper, libparams-validate-perl, libmailtools-perl, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libhttp-server-simple-perl, libtest-www-mechanize-perl, libmail-rfc822-address-perl
Package: debbugs
Architecture: all
-Depends: ${perl:Depends}, exim4 | mail-transport-agent, libdebbugs-perl
+Depends: ${perl:Depends}, exim4 | mail-transport-agent, libdebbugs-perl, libmail-rfc822-address-perl
Recommends: debbugs-web
Suggests: spamassassin (>= 3.0), libcgi-alert-perl
Description: The bug tracking system based on the active Debian BTS
use Debbugs::Control qw(:archive :log);
use Debbugs::Log qw(:misc);
+use Mail::RFC822::Address;
+
$lib_path = $gLibPath;
require "$lib_path/errorlib";
$ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
$ref= $1;
$version= $2;
if (&setbug) {
- $action= "$gBug marked as not found in version $version.";
+ $action= "$gBug no longer marked as found in version $version.";
if (length($data->{done})) {
$extramessage= "(By the way, this $gBug is currently marked as done.)\n";
}
if (&setbug) {
$action=
defined($version) ?
- "$gBug marked as not fixed in version $version." :
+ "$gBug no longer marked as fixed in version $version." :
"$gBug reopened.";
do {
&addmaintainers($data);
if ($ref =~ m/^-\d+$/ && defined $clonebugs{$ref}) {
$ref = $clonebugs{$ref};
}
- if (&getbug) {
+ if (not Mail::RFC822::Address::valid($newsubmitter)) {
+ transcript("$newsubmitter is not a valid e-mail address; not changing submitter\n");
+ $errors++;
+ }
+ elsif (&getbug) {
if (&checkpkglimit) {
&foundbug;
&addmaintainers($data);