]> git.deb.at Git - deb/packages.git/commitdiff
Simply some stuff due to (suite,arch) now being unique and $archive being
authorJeroen van Wolffelaar <jeroen@wolffelaar.nl>
Thu, 23 Feb 2006 02:52:48 +0000 (02:52 +0000)
committerJeroen van Wolffelaar <jeroen@wolffelaar.nl>
Thu, 23 Feb 2006 02:52:48 +0000 (02:52 +0000)
'just' a field

lib/Packages/DoSearch.pm
lib/Packages/DoShow.pm

index 275cb9bebc73d4a3846f4645b6b1779be1af0e3e..f55f2cf7e05d28c29788fe6abe96b6b06d724ba4 100644 (file)
@@ -168,20 +168,13 @@ sub do_search {
                
                my ($pkg) = $pkg_t =~ m/^(.+)/; # untaint
                if ($arch ne 'virtual') {
-                   my $real_archive;
-                   if ($archive =~ /^(security|non-US)$/) {
-                       $real_archive = $archive;
-                       $archive = 'us';
-                   }
-
-                   $pkgs{$pkg}{$suite}{$archive}{$version}{$arch} = 1;
-                   $subsect{$pkg}{$suite}{$archive}{$version} = $subsection;
-                   $sect{$pkg}{$suite}{$archive}{$version} = $section
+                   $pkgs{$pkg}{$suite}{$version}{$arch} = 1;
+                   $subsect{$pkg}{$suite}{$version} = $subsection;
+                   $sect{$pkg}{$suite}{$version} = $section
                        unless $section eq 'main';
-                   $archives{$pkg}{$suite}{$archive}{$version} = $real_archive
-                       if $real_archive;
+                   $archives{$pkg}{$suite}{$version} = $archive;
                    
-                   $desc{$pkg}{$suite}{$archive}{$version} = $desc;
+                   $desc{$pkg}{$suite}{$version} = $desc;
                } else {
                    $provided_by{$pkg}{$suite} = [ split /\s+/, $desc ];
                }
@@ -270,28 +263,25 @@ sub print_package {
     my $str = '<h3>'.sprintf( _g( 'Package %s' ), $pkg ).'</h3>';
     $str .= '<ul>';
     foreach my $suite (@SUITES) {
-       foreach my $archive (@ARCHIVES) {
-           next if $archive eq 'security';
-           next if $archive eq 'non-US';
-           my $path = $suite.(($archive ne 'us')?"/$archive":'');
-           if (exists $pkgs->{$suite}{$archive}) {
+           my $path = $suite;
+           if (exists $pkgs->{$suite}) {
                my %archs_printed;
-               my @versions = version_sort keys %{$pkgs->{$suite}{$archive}};
+               my @versions = version_sort keys %{$pkgs->{$suite}};
                my $origin_str = "";
-               if ($sect->{$suite}{$archive}{$versions[0]}) {
-                   $origin_str .= " ".marker($sect->{$suite}{$archive}{$versions[0]});
+               if ($sect->{$suite}{$versions[0]}) {
+                   $origin_str .= " ".marker($sect->{$suite}{$versions[0]});
                }
                $str .= sprintf( "<li><a href=\"$ROOT/%s/%s\">%s</a> (%s): %s   %s\n",
-                                $path, $pkg, $path, $subsect->{$suite}{$archive}{$versions[0]},
-                                $desc->{$suite}{$archive}{$versions[0]}, $origin_str );
+                                $path, $pkg, $path, $subsect->{$suite}{$versions[0]},
+                                $desc->{$suite}{$versions[0]}, $origin_str );
                
                foreach my $v (@versions) {
                    my $archive_str = "";
-                   if ($archives->{$suite}{$archive}{$v}) {
-                       $archive_str .= " ".marker($archives->{$suite}{$archive}{$v});
+                   if ($archives->{$suite}{$v} ne 'us') {
+                       $archive_str .= " ".marker($archives->{$suite}{$v});
                    }
                    
-                   my @archs_to_print = grep { !$archs_printed{$_} } sort keys %{$pkgs->{$suite}{$archive}{$v}};
+                   my @archs_to_print = grep { !$archs_printed{$_} } sort keys %{$pkgs->{$suite}{$v}};
                    $str .= sprintf( "<br>%s$archive_str: %s\n",
                                     $v, join (" ", @archs_to_print ))
                        if @archs_to_print;
@@ -308,7 +298,6 @@ sub print_package {
                $str .= _g( 'provided by: ' ).
                    join( ', ', map { "<a href=\"$ROOT/$path/$_\">$_</a>"  } @$p);
            }
-       }
     }
     $str .= "</ul>\n";
     return $str;
index b5a12876b58cc3caba94dfcafab19d57d68755bc..c9940a16bfc980af9a75cca6852a7108b90b4b94 100644 (file)
@@ -75,19 +75,13 @@ sub do_show {
            foreach (@results, @non_results) {
                my $a = $_->[1];
                my $s = $_->[2];
-               if ($a =~ /^(?:us|security|non-US)$/o) {
-                   $all_suites{$s}++;
-               } else {
-                   $all_suites{"$s/$a"}++;
-               }
+               $all_suites{$s}++;
            }
            foreach (suites_sort(keys %all_suites)) {
-               if (("$suite/$archive" eq $_)
-                   || (!$all_suites{"$suite/$archive"} && ($suite eq $_))) {
+               if ($suite eq $_) {
                    $$menu .= "[ <strong>$_</strong> ] ";
                } else {
-                   $$menu .=
-                       "[ <a href=\"$ROOT/$_/$encodedpkg\">$_</a> ] ";
+                   $$menu .= "[ <a href=\"$ROOT/$_/$encodedpkg\">$_</a> ] ";
                }
            }
            $$menu .= '<br>';