]> git.deb.at Git - deb/packages.git/blobdiff - cgi-bin/search_packages.pl
Make it more obvious what are static strings and what are parameters
[deb/packages.git] / cgi-bin / search_packages.pl
index 35729156a5011cba138fb90c3f01997fdf75bdac..c74ffc27689007cb035b47133d18287a4f5ffc15 100755 (executable)
@@ -113,7 +113,7 @@ my %params = Packages::Search::parse_params( $input, \%params_def, \%opts );
 #XXX: Don't use alternative output formats yet
 $format = 'html';
 if ($format eq 'html') {
-    print $input->header;
+    print $input->header( -charset => 'utf-8' );
 }
 
 if ($params{errors}{keywords}) {
@@ -157,6 +157,9 @@ unless (@Packages::CGI::fatal_errors) {
        push @results, @{ do_names_search( $keyword, \%sources,
                                           $sp_obj,
                                           \&read_src_entry, \%opts ) };
+    } elsif ($searchon eq 'contents') {
+       require "./search_contents.pl";
+       &contents($input);
     } else {
        push @results, @{ do_names_search( $keyword, \%packages,
                                           $p_obj,
@@ -274,12 +277,13 @@ if (@results) {
 
 my @pkgs = sort(keys %pkgs, keys %provided_by);
        if ($opts{format} eq 'html') {
-           my ($start, $end) = multipageheader( $input, scalar @pkgs, \%opts );
-           my $count = 0;
+           #my ($start, $end) = multipageheader( $input, scalar @pkgs, \%opts );
+           print "<p>Found <em>".(scalar @pkgs)."</em> matching packages,";
+           #my $count = 0;
        
            foreach my $pkg (@pkgs) {
-               $count++;
-               next if $count < $start or $count > $end;
+               #$count++;
+               #next if $count < $start or $count > $end;
                printf "<h3>Package %s</h3>\n", $pkg;
                print "<ul>\n";
                foreach my $suite (@SUITES) {
@@ -289,7 +293,7 @@ my @pkgs = sort(keys %pkgs, keys %provided_by);
                            my @versions = version_sort keys %{$pkgs{$pkg}{$suite}{$archive}};
                            my $origin_str = "";
                            if ($sect{$pkg}{$suite}{$archive}{$versions[0]}) {
-                               $origin_str .= " [<span style=\"color:red\">$sect{$pkg}{$suite}{$versions[0]}</span>]";
+                               $origin_str .= " [<span style=\"color:red\">$sect{$pkg}{$suite}{$archive}{$versions[0]}</span>]";
                            }
                            printf "<li><a href=\"$ROOT/%s/%s\">%s</a> (%s): %s   %s\n",
                            $path, $pkg, $path, $subsect{$pkg}{$suite}{$archive}{$versions[0]},
@@ -329,12 +333,13 @@ my @pkgs = sort(keys %pkgs, keys %provided_by);
        }
 
        if ($opts{format} eq 'html') {
-           my ($start, $end) = multipageheader( $input, scalar keys %pkgs, \%opts );
-           my $count = 0;
+           #my ($start, $end) = multipageheader( $input, scalar keys %pkgs, \%opts );
+           print "<p>Found <em>".(scalar keys %pkgs)."</em> matching packages,";
+           #my $count = 0;
            
            foreach my $pkg (sort keys %pkgs) {
-               $count++;
-               next if ($count < $start) or ($count > $end);
+               #$count++;
+               #next if ($count < $start) or ($count > $end);
                printf "<h3>Source package %s</h3>\n", $pkg;
                print "<ul>\n";
                foreach my $suite (@SUITES) {
@@ -364,7 +369,7 @@ my @pkgs = sort(keys %pkgs, keys %provided_by);
            }
        }
     }
-    printindexline( $input, scalar keys %pkgs, \%opts );
+    #printindexline( $input, scalar keys %pkgs, \%opts );
 }
 #print_results(\@results, \%opts) if @results;;
 my $tet1 = new Benchmark;