X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FPackages%2FDoSearch.pm;h=f55f2cf7e05d28c29788fe6abe96b6b06d724ba4;hb=ace28538cff532f8c5ee31b2cadaf577c0ced079;hp=776b288fd9745169e84582b15fa3a2db85c1ec6d;hpb=f27f1fcc5bffc0696f694e962eb40dbb0c554855;p=deb%2Fpackages.git diff --git a/lib/Packages/DoSearch.pm b/lib/Packages/DoSearch.pm index 776b288..f55f2cf 100644 --- a/lib/Packages/DoSearch.pm +++ b/lib/Packages/DoSearch.pm @@ -86,19 +86,24 @@ sub do_search { my $std = timediff($st1, $st0); debug( "Search took ".timestr($std) ) if DEBUG; - my $suite_wording = $suites_enc eq "all" ? "all suites" - : "suite(s) $suites_enc"; - my $section_wording = $sections_enc eq 'all' ? "all sections" - : "section(s) $sections_enc"; - my $arch_wording = $archs_enc eq 'any' ? "all architectures" - : "architecture(s) $archs_enc"; + my $suite_wording = $suites_enc eq "all" ? _g("all suites") + : sprintf(_g("suite(s) %s", $suites_enc) ); + my $section_wording = $sections_enc eq 'all' ? _g("all sections") + : sprintf(_g("section(s) %s", $sections_enc) ); + my $arch_wording = $archs_enc eq 'any' ? _g("all architectures") + : sprintf(_g("architecture(s) %s", $archs_enc) ); if ($searchon eq "names") { - my $source_wording = $opts->{source} ? "source " : ""; - my $exact_wording = $opts->{exact} ? "named" : "that names contain"; - msg( "You have searched for ${source_wording}packages $exact_wording $keyword_enc in $suite_wording, $section_wording, and $arch_wording." ); + my $source_wording = $opts->{source} ? _g("source packages") : _g("packages"); + # sorry to all translators for that one... (patches welcome) + msg( sprintf( _g( "You have searched for %s that names contain %s in %s, %s, and %s." ), + $source_wording, $keyword_enc, + $suite_wording, $section_wording, $arch_wording ) ); } else { - my $exact_wording = $opts->{exact} ? "" : " (including subword matching)"; - msg( "You have searched for $keyword_enc in packages names and descriptions in $suite_wording, $section_wording, and $arch_wording$exact_wording." ); + my $exact_wording = $opts->{exact} ? "" : _g(" (including subword matching)"); + msg( sprintf( _g( "You have searched for %s in packages names and descriptions in %s, %s, and %s%s." ), + $keyword_enc, + $suite_wording, $section_wording, $arch_wording, + $exact_wording ) ); } if ($Packages::Search::too_many_hits) { @@ -163,22 +168,15 @@ 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}{$archive} = [ split /\s+/, $desc ]; + $provided_by{$pkg}{$suite} = [ split /\s+/, $desc ]; } } @@ -265,45 +263,41 @@ sub print_package { my $str = '

'.sprintf( _g( 'Package %s' ), $pkg ).'

'; $str .= '\n"; return $str;