]> git.donarmstrong.com Git - debbugs.git/commitdiff
merge changes from dla source branch
authorDebian BTS <debbugs@rietz>
Thu, 9 Aug 2007 18:48:22 +0000 (18:48 +0000)
committerDebian BTS <debbugs@rietz>
Thu, 9 Aug 2007 18:48:22 +0000 (18:48 +0000)
Debbugs/Packages.pm
Debbugs/SOAP.pm
cgi/bugreport.cgi
cgi/pkgreport.cgi
debian/changelog
debian/control
scripts/service.in

index b34e1b5643ba8e8cbb5342be48c7c60ab9a1efb1..7103fc10daf9fefd1afaa7e2918f57267ae7300d 100644 (file)
@@ -254,6 +254,11 @@ matching this version was uploaded
 
 =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
@@ -277,6 +282,9 @@ sub get_versions{
                                           source  => {type    => BOOLEAN,
                                                       default => 0,
                                                      },
+                                          no_source_arch => {type => BOOLEAN,
+                                                             default => 0,
+                                                            },
                                          },
                               );
      my $versions;
@@ -303,7 +311,9 @@ sub get_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}} :
index ed669a125f64d9c6768efedf6caa8327f384250f..e7f159c497ad3375ce4302f32f883c1df40cd1ef 100644 (file)
@@ -46,8 +46,6 @@ use Storable qw(nstore retrieve);
 
 
 our $CURRENT_VERSION = 1;
-our %DEBBUGS_SOAP_COOKIES;
-
 
 =head2 get_usertag
 
@@ -84,10 +82,22 @@ use Debbugs::Status;
 =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
@@ -95,11 +105,19 @@ See L<Debbugs::Status::get_bug_status> for details.
 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;
          }
@@ -132,19 +150,7 @@ sub get_bugs{
      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;
@@ -162,7 +168,7 @@ guaranteed to exist, but they should in the most common cases.]
 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];
 
 }
@@ -250,6 +256,26 @@ sub __populate_version{
      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;
 
 
index 5b46729639605ba74a0b941b3374d2cd46bd3b78..856a35be4e8c27c785a9ab0c55da7b433e9fa648 100755 (executable)
@@ -326,7 +326,9 @@ if (length($status{done})) {
 }
 
 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~-]+?/?)((\&gt\;)?[)]?[']?[:.\,]?(\s|$)),<a href=\"$1\">$1</a>$3,go;
+    push @descstates, "<strong>Forwarded</strong> to $forward_link";
 }
 
 
@@ -605,7 +607,8 @@ function toggle_infmessages()
         {
                 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;
                 }
         }
 }
index 37f4196dbaab5977f3bcf2170d564e532e72bdff..48d755b016d9dcc65edba46330e7cccdae20b0d5 100755 (executable)
@@ -308,6 +308,7 @@ while (my ($key,$value) = splice @search_key_order, 0, 2) {
                                           (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;
@@ -398,9 +399,17 @@ for my $package (make_list($param{src}||[])) {
 
 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 "
@@ -411,12 +420,6 @@ sub output_package_info{
     } 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 ) {
index 53b2b7304cdf207b9efbc9599cf4aeb9b4067c1e..94966ae1583b63936f1b447d6393a2b568b87d3a 100644 (file)
@@ -198,6 +198,13 @@ debbugs (2.4.2) UNRELEASED; urgency=low
     - 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
index b2e5db2ecbd4a5f5f4fc9c4b80da76fdaa7900f0..a9788f66a02ede1a4044cdc48808c861d065453f 100644 (file)
@@ -4,11 +4,11 @@ Priority: extra
 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
index 3c1ed180414cafeb83225eecdaa6c4795b7b415c..0cfe4f0f50757abab382d52f2526e1b2c1a8cd25 100755 (executable)
@@ -17,6 +17,8 @@ use Debbugs::CGI qw(html_escape);
 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'};
@@ -584,7 +586,7 @@ END
         $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";
             }
@@ -620,7 +622,7 @@ END
         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);
@@ -636,7 +638,11 @@ END
         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);