5 use CGI::Carp qw(fatalsToBrowser);
8 print "Content-type: text/html\n\n";
9 print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">', "\n";
10 print "<html><head><title>bpo package search</title></head><body>\n";
14 print "<form action=\"search.pl\" method=\"POST\">\n";
15 print "<H1>bpo package search</H1>\n";
16 print "<input type=\"text\" name=\"query\" size=\"40\" maxlength=\"40\">\n";
17 print "<td valign=\"top\"><input type=\"submit\" name=\"send\" value=\"send\"></td>\n";
23 print "<p>Server performed a query with the keyword ";
27 foreach my $value (qw/ main contrib non-free /) {
28 print "<h1>Results for packages listed in ", $value, ":</h1>\n";
30 open SOURCES, "$value/Sources" or die "Can't open Source file: $!";
31 my @sourceslist=<SOURCES>;
34 for (my $i = 0; $i < @sourceslist; $i++) {
35 $_ = @sourceslist[$i];
36 if (/^Package:.*$query.*/) {
37 my $pver=&findnextver($i, @sourceslist);
38 my $pdir=&findnextdir($i, @sourceslist);
40 print @sourceslist[$i],"<br>\n";
41 print $pver, "<br>\n";
42 print "<a href=\"http://www.backports.org/debian/", $pdir,"\">http://www.backports.org/debian/",$pdir,"</a><br>\n";
53 my ($startpos, @list) = @_;
54 for (my $i = $startpos; $i < @list; $i++) {
64 my ($startpos, @list) = @_;
65 for (my $i = $startpos; $i < @list; $i++) {
67 if (/^Directory:.*/) {
68 my @dirsplit = split / /, $_;
78 if ($query->param('send') eq "send") {
79 &performsearch($query->param('query'));
85 print "</body></html>\n";