X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FPackages%2FDoSearch.pm;h=35ee88fa5a02f0705f3a38121075e3a898fe70a7;hb=a430a7f2c477de0e9952384e896e7c78cea3f32f;hp=0ff2e9b7c50231a6380fe5a4deaef6328b78b18c;hpb=33c3adfb631d4c1fb6690a02117674a984d0e6ee;p=deb%2Fpackages.git diff --git a/lib/Packages/DoSearch.pm b/lib/Packages/DoSearch.pm index 0ff2e9b..35ee88f 100644 --- a/lib/Packages/DoSearch.pm +++ b/lib/Packages/DoSearch.pm @@ -39,10 +39,7 @@ sub do_search { # for URL construction my $keyword_esc = uri_escape( $keyword ); - my $suites_param = join ',', @{$params->{values}{suite}{no_replace}}; - my $sections_param = join ',', @{$params->{values}{section}{no_replace}}; - my $archs_param = join ',', @{$params->{values}{arch}{no_replace}}; - $opts->{common_params} = "suite=$suites_param§ion=$sections_param&keywords=$keyword_esc&searchon=$searchon&arch=$archs_param"; + $opts->{keywords_esc} = $keyword_esc; # for output my $keyword_enc = encode_entities $keyword || ''; @@ -86,7 +83,7 @@ sub do_search { my $std = timediff($st1, $st0); debug( "Search took ".timestr($std) ) if DEBUG; - my $suite_wording = $suites_enc eq "all" ? _g("all suites") + my $suite_wording = $suites_enc =~ /^(default|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) ); @@ -134,7 +131,7 @@ sub do_search { if ($opts->{exact}) { hint( sprintf( _g( 'You have searched only for words exactly matching your keywords. You can try to search allowing subword matching.' ), - encode_entities("$SEARCH_URL?exact=0&$opts->{common_params}") ) ); + encode_entities(make_search_url('',"keywords=$keyword_esc",{exact => 0})) ) ); } } hint( sprintf( _g( 'You can try a different search on the Packages search page.' ), "$SEARCH_PAGE#search_packages" ) ); @@ -250,7 +247,7 @@ sub print_packages { } } elsif (@$pkgs_list) { $str .= "

".sprintf( _g( '%s results have not been displayed because you requested only exact matches.' ), - encode_entities("$SEARCH_URL?exact=0&$opts->{common_params}"), + encode_entities(make_search_url('',"keywords=$opts->{keyword_esc}",{exact => 0})), scalar @$pkgs_list )."

"; } $str .= ''; @@ -264,7 +261,7 @@ sub print_package { my $str = '

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

'; $str .= '\n";