]> git.donarmstrong.com Git - debbugs.git/commitdiff
merge changes from dla source
authorDebian BTS <debbugs@rietz>
Thu, 25 Sep 2008 20:07:56 +0000 (20:07 +0000)
committerDebian BTS <debbugs@rietz>
Thu, 25 Sep 2008 20:07:56 +0000 (20:07 +0000)
Debbugs/Bugs.pm
Debbugs/CGI.pm
Debbugs/CGI/Pkgreport.pm
cgi/bugreport.cgi
cgi/pkgreport.cgi
cgi/search.cgi
cgi/soap.cgi
cgi/version.cgi
debian/changelog
scripts/age-1 [changed mode: 0755->0644]
templates/en_US/cgi/bugreport_pkginfo.tmpl

index 36bcc7b487e6c6c1c3d84de20c66aff68445b104..dfcb0c52ba805383593e00335ce79269cf590248 100644 (file)
@@ -430,6 +430,14 @@ sub get_bugs_by_idx{
                              );
      my %bugs = ();
 
+     # If we're given an empty maint (unmaintained packages), we can't
+     # handle it, so bail out here
+     for my $maint (make_list(exists $param{maint}?$param{maint}:[])) {
+         if (defined $maint and $maint eq '') {
+              die "Can't handle empty maint (unmaintained packages) in get_bugs_by_idx";
+         }
+     }
+
      # We handle src packages, maint and maintenc by mapping to the
      # appropriate binary packages, then removing all packages which
      # don't match all queries
@@ -532,6 +540,9 @@ sub get_bugs_flatfile{
 #                                        dist      => {type => SCALAR|ARRAYREF,
 #                                                      optional => 1,
 #                                                     },
+                                         bugs      => {type => SCALAR|ARRAYREF,
+                                                       optional => 1,
+                                                      },
                                          archive   => {type => BOOLEAN,
                                                        default => 1,
                                                       },
@@ -559,6 +570,23 @@ sub get_bugs_flatfile{
          @usertag_bugs{make_list(@{$param{usertags}}{make_list($param{tag})})
                        } = (1) x make_list(@{$param{usertags}}{make_list($param{tag})});
      }
+     my $unmaintained_packages = 0;
+     # unmaintained packages is a special case
+     for my $maint (make_list(exists $param{maint}?$param{maint}:[])) {
+         if (defined $maint and $maint eq '' and not $unmaintained_packages) {
+              $unmaintained_packages = 1;
+              our %maintainers = %{getmaintainers()};
+              $param{function} = [exists $param{function}?
+                                  (ref $param{function}?@{$param{function}}:$param{function}):(),
+                                  sub {my %d=@_;
+                                       foreach my $try (splitpackages($d{"pkg"})) {
+                                            return 1 if not exists $maintainers{$try};
+                                       }
+                                       return 0;
+                                  }
+                                 ];
+         }
+     }
      # We handle src packages, maint and maintenc by mapping to the
      # appropriate binary packages, then removing all packages which
      # don't match all queries
@@ -569,7 +597,7 @@ sub get_bugs_flatfile{
         exists $param{src} or
         exists $param{maint}) {
          delete @param{qw(maint src)};
-         $param{package} = [@packages];
+         $param{package} = [@packages] if @packages;
      }
      my $grep_bugs = 0;
      my %bugs;
@@ -577,15 +605,17 @@ sub get_bugs_flatfile{
          $bugs{$_} = 1 for make_list($param{bugs});
          $grep_bugs = 1;
      }
-     if (exists $param{owner} or exists $param{correspondent} or exists $param{affects}) {
-         $bugs{$_} = 1 for get_bugs_by_idx(exists $param{correspondent}?(correspondent => $param{correspondent}):(),
-                                           exists $param{owner}?(owner => $param{owner}):(),
-                                           exists $param{affects}?(affects => $param{affects}):(),
+     # These queries have to be handled by get_bugs_by_idx
+     if (exists $param{owner}
+        or exists $param{correspondent}
+        or exists $param{affects}) {
+         $bugs{$_} = 1 for get_bugs_by_idx(map {exists $param{$_}?($_,$param{$_}):()}
+                                           qw(owner correspondent affects),
                                           );
          $grep_bugs = 1;
      }
      my @bugs;
-     while (<$flatfile>) {
+     BUG: while (<$flatfile>) {
          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};
@@ -629,14 +659,16 @@ sub get_bugs_flatfile{
               my @bug_tags = split ' ', $tags;
               my @packages = splitpackages($pkg);
               my $package = (@packages > 1)?\@packages:$packages[0];
-              next unless
-                   $param{function}->(pkg       => $package,
-                                      bug       => $bug,
-                                      status    => $status,
-                                      submitter => $submitter,
-                                      severity  => $severity,
-                                      tags      => \@bug_tags,
-                                     );
+              for my $function (make_list($param{function})) {
+                   next BUG unless
+                        $function->(pkg       => $package,
+                                    bug       => $bug,
+                                    status    => $status,
+                                    submitter => $submitter,
+                                    severity  => $severity,
+                                    tags      => \@bug_tags,
+                                   );
+              }
          }
          push @bugs, $bug;
      }
index 1ba47996744eeb2ec4358db4da55910e30d9ba8e..cceeb36cdddf8df589536e2c24bf604be3c5a7b4 100644 (file)
@@ -350,8 +350,10 @@ our @package_search_key_order = (package   => 'in package',
                                 submitter => 'submitted by',
                                 owner     => 'owned by',
                                 status    => 'with status',
+                                affects   => 'which affect package',
                                 correspondent => 'with mail from',
                                 newest        => 'newest bugs',
+                                bugs          => 'in bug',
                                );
 our %package_search_keys = @package_search_key_order;
 
index 085b31ea321ee8d7397f78154b55cbcd3fc4e393..beba95a89694f563b6085fccf20664d66ee9b800 100644 (file)
@@ -129,17 +129,18 @@ sub generate_package_info{
      my @references;
      my $pseudodesc = getpseudodesc();
      if ($package and defined($pseudodesc) and exists($pseudodesc->{$package})) {
-         push @references, "to the <a href=\"http://${debbugs::gWebDomain}/pseudo-packages${debbugs::gHTMLSuffix}\">".
+         push @references, "to the <a href=\"http://$config{web_domain}/pseudo-packages$config{html_suffix}\">".
               "list of other pseudo-packages</a>";
      }
      else {
-         if ($package and defined $gPackagePages) {
+         if ($package and defined $config{package_pages} and length $config{package_pages}) {
               push @references, sprintf "to the <a href=\"%s\">%s package page</a>",
-                   html_escape("http://${gPackagePages}/$package"), html_escape("$package");
+                   html_escape("http://$config{package_pages}/$package"), html_escape("$package");
          }
-         if (defined $gSubscriptionDomain) {
+         if (defined $config{subscription_domain} and
+             length $config{subscription_domain}) {
               my $ptslink = $param{binary} ? $srcforpkg : $package;
-              push @references, q(to the <a href="http://).html_escape("$gSubscriptionDomain/$ptslink").q(">Package Tracking System</a>);
+              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.
          if ($param{binary} and $srcforpkg) {
@@ -154,12 +155,12 @@ sub generate_package_info{
          $references[$#references] = "or $references[$#references]" if @references > 1;
          print {$output} "<p>You might like to refer ", join(", ", @references), ".</p>\n";
      }
-     if (defined $param{maint} || defined $param{maintenc}) {
+     if (defined $maint) {
          print {$output} "<p>If you find a bug not listed here, please\n";
          printf {$output} "<a href=\"%s\">report it</a>.</p>\n",
-              html_escape("http://${debbugs::gWebDomain}/Reporting${debbugs::gHTMLSuffix}");
+              html_escape("http://$config{web_domain}/Reporting$config{html_suffix}");
      }
-     if (not $maint and not @{$param{bugs}}) {
+     if (not defined $maint and not @{$param{bugs}}) {
          print {$output} "<p>There is no record of the " . html_escape($package) .
               ($param{binary} ? " package" : " source package") .
                    ", and no bugs have been filed against it.</p>";
index d01a286bf39e9097db6efc2e8f27fb0620bdab0c..456bd69e9091d7264dc0de750e3bc0b36b50d8e3 100755 (executable)
@@ -76,6 +76,11 @@ if (not defined $buglog) {
                      -type => "text/html",
                      -charset => 'utf-8',
                     );
+     print fill_in_template(template=>'cgi/no_such_bug',
+                           variables => {modify_time => strftime('%a, %e %b %Y %T UTC', gmtime),
+                                         bug_num     => $ref,
+                                        },
+                          );
      exit 0;
 }
 
@@ -254,7 +259,7 @@ my @packages = splitpackages($status{package});
 
 foreach my $pkg (@packages) {
      $package{$pkg} = {maintainer => exists($maintainer{$pkg}) ? $maintainer{$pkg} : '(unknown)',
-                      source     => exists($pkgsrc{$pkg}) ? $pkgsrc{$pkg} : '(unknown)',
+                      exists($pkgsrc{$pkg}) ? (source => $pkgsrc{$pkg}) : (),
                       package    => $pkg,
                      };
 }
index 2a69dfd1497713f05f4fa327173e186561fcb1ff..3ddad9bf17431dc1f97cd5cc192d5104a5448fe0 100755 (executable)
@@ -24,6 +24,8 @@ use Debbugs::Common qw(getparsedaddrs make_list getmaintainers getpseudodesc);
 use Debbugs::Bugs qw(get_bugs bug_filter newest_bug);
 use Debbugs::Packages qw(getsrcpkgs getpkgsrc get_versions);
 
+use Debbugs::Status qw(splitpackages);
+
 use Debbugs::CGI qw(:all);
 
 use Debbugs::CGI::Pkgreport qw(:all);
@@ -77,10 +79,15 @@ if (exists $param{form_options} and defined $param{form_options}) {
          next unless exists $param{$incexc};
          $param{$incexc} = [grep /\S\:\S/, make_list($param{$incexc})];
      }
+     for my $key (keys %package_search_keys) {
+         next unless exists $param{key};
+         $param{$key} = [map {split /\s*,\s*/} make_list($param{$key})];
+     }
      # kill off keys for which empty values are meaningless
-     for my $key (qw(package src submitter severity status dist)) {
+     for my $key (qw(package src submitter affects severity status dist)) {
          next unless exists $param{$key};
-         $param{$key} = [grep {length $_}  make_list($param{$key})];
+         $param{$key} = [grep {defined $_ and length $_}
+                         make_list($param{$key})];
      }
      print $q->redirect(munge_url('pkgreport.cgi?',%param));
      exit 0;
@@ -332,8 +339,9 @@ my @temp = @package_search_key_order;
 while (my ($key,$value) = splice @temp, 0, 2) {
      next unless exists $param{$key};
      my @entries = ();
-     $param{$key} = [map {split /\s*,\s*/} make_list($param{$key})];
-     for my $entry (grep {defined $_ and length $_ } make_list($param{$key})) {
+     for my $entry (make_list($param{$key})) {
+         # we'll handle newest below
+         next if $key eq 'newest';
          my $extra = '';
          if (exists $param{dist} and ($key eq 'package' or $key eq 'src')) {
               my %versions = get_versions(package => $entry,
@@ -358,39 +366,34 @@ while (my ($key,$value) = splice @temp, 0, 2) {
               }
               $extra= " ($verdesc)" if keys %versions;
          }
-         push @entries, $entry.$extra;
+         if ($key eq 'maint' and $entry eq '') {
+              push @entries, "no one (packages without maintainers)"
+         }
+         else {
+              push @entries, $entry.$extra;
+         }
      }
      push @title,$value.' '.join(' or ', @entries) if @entries;
 }
-my $title = $gBugs.' '.join(' and ', map {/ or /?"($_)":$_} @title);
-@title = ();
-
-# we have to special case the maint="" search, unfortunatly.
-if (defined $param{maint} and $param{maint} eq "" or ref($param{maint}) and not @{$param{maint}}) {
-     my %maintainers = %{getmaintainers()};
-     @bugs = get_bugs(function =>
-                     sub {my %d=@_;
-                          foreach my $try (splitpackages($d{"pkg"})) {
-                               return 1 if not exists $maintainers{$try};
-                          }
-                          return 0;
-                     }
-                    );
-     $title = $gBugs.' in packages with no maintainer';
-}
-elsif (defined $param{newest}) {
+if (defined $param{newest}) {
      my $newest_bug = newest_bug();
      @bugs = ($newest_bug - $param{newest} + 1) .. $newest_bug;
-     $title = @bugs.' newest '.$gBugs;
-}
-else {
-     #yeah for magick!
-     @bugs = get_bugs((map {exists $param{$_}?($_,$param{$_}):()}
-                      keys %package_search_keys, 'archive'),
-                     usertags => \%ut,
-                    );
+     push @title, 'in '.@bugs.' newest reports';
+     $param{bugs} = [exists $param{bugs}?make_list($param{bugs}):(),
+                    @bugs,
+                   ];
 }
 
+my $title = $gBugs.' '.join(' and ', map {/ or /?"($_)":$_} @title);
+@title = ();
+
+#yeah for magick!
+@bugs = get_bugs((map {exists $param{$_}?($_,$param{$_}):()}
+                 grep {$_ ne 'newest'}
+                 keys %package_search_keys, 'archive'),
+                usertags => \%ut,
+               );
+
 if (defined $param{version}) {
      $title .= " at version $param{version}";
 }
index 03d2cc571c119a1f9ee176beff32a472b887f20f..b1f5e09f84724a8b3e38377db960073d275b7ce9 100755 (executable)
@@ -14,7 +14,7 @@ BEGIN{
 
 use CGI::Simple;
 
-use CGI::Alert 'don@donarmstrong.com';
+# use CGI::Alert 'nobody@example.com';
 
 use Search::Estraier;
 use Debbugs::Config qw(:config);
index 1ca87b97b3c2be50bc5e7a903f44e5ea50e4c5f0..f6b0d0410c4daeeb5f29dbd4a6a7e3ae9e0615fc 100755 (executable)
@@ -21,7 +21,7 @@ my $soap = Debbugs::SOAP::Server
 # kill off all of the date/time related bits in the serializer.
 my $typelookup = $soap->serializer()->{_typelookup};
 for my $key (keys %{$typelookup}) {
-     next unless /Month|Day|Year|date|time|duration/i;
+     next unless defined $_ and /Month|Day|Year|date|time|duration/i;
      delete $typelookup->{$key};
 }
 $soap->handle;
index d1e8960b700b5fc9bbe877dc490a9c3d9eea0e37..ed0be6304ac58e094ffe4e3d8d458238e9391e48 100755 (executable)
@@ -15,12 +15,12 @@ BEGIN{
 use CGI::Simple;
 
 # by default send this message nowhere
-use CGI::Alert q(nobody@example.com);
+use CGI::Alert q(nobody@example.com);
 
 use Debbugs::Config qw(:config);
 
 BEGIN{
-     $CGI::Alert::Maintainer = $config{maintainer};
+     $CGI::Alert::Maintainer = $config{maintainer};
 }
 
 use Debbugs::CGI qw(htmlize_packagelinks html_escape cgi_parameters munge_url);
index 949ef46a33283457dd7b94858bfd19561fce95ab..7e3d7685a70aeffe5058d0ae9b9a380b34af8487 100644 (file)
@@ -224,6 +224,8 @@ debbugs (2.4.2) UNRELEASED; urgency=low
     extra status box (closes: #499990) Thanks to James Vega for the patch.
   * Return 404 when a bug number that does not exist is used
     (closes: #499997)
+  * Comment out CGI::Alert use for the time being (closes: #499681)
+  * No longer hard-code paths in age-1 (closes: #499682)
 
   
  -- Colin Watson <cjwatson@debian.org>  Fri, 20 Jun 2003 18:57:25 +0100
old mode 100755 (executable)
new mode 100644 (file)
index cc2e72d..65c39d7
@@ -1,7 +1,7 @@
 #!/bin/sh
 # $Id: age-1.in,v 1.3 2002/01/06 10:46:24 ajt Exp $
 set -e
-cd /var/lib/debbugs/spool/db-h
+cd "$(perl -MDebbugs::Config=:config -e 'print $config{spool_dir}')"
 test -f ./-3.log && rm ./-3.log
 test -f ./-2.log && mv ./-2.log ./-3.log
 test -f ./-1.log && mv ./-1.log ./-2.log
index 22806f7c6e8fd2891882366f2eb10c007408c9ed..4a39ba375ddc4a1da94081b8d97baa0ddbfa35c3 100644 (file)
@@ -8,8 +8,10 @@
  for my $package (values %package) {
      $output .= q(Maintainer for ).package_links(package=>$package->{package}).qq( is ).
                 package_links(maintainer => $package->{maintainer}).qq(; );
-     $output .= q(Source for ).package_links(package=>$package->{package}).qq( is ).
-                package_links(source => $package->{source}).qq(. );
+     if (exists $package->{source}) {
+       $output .= q(Source for ).package_links(package=>$package->{package}).qq( is ).
+                   package_links(source => $package->{source}).qq(. );
+     }
  }
  $output;
 }</p>