7 #require '/usr/lib/debbugs/errorlib';
10 require '/etc/debbugs/config';
11 require '/etc/debbugs/text';
13 use vars qw($gPackagePages $gWebDomain);
15 if (defined $ENV{REQUEST_METHOD} and $ENV{REQUEST_METHOD} eq 'HEAD') {
16 print "Content-Type: text/html; charset=utf-8\n\n";
20 my $path = $ENV{PATH_INFO};
21 my %param = readparse();
23 if ($path =~ m,^/(\d+)(/(\d)+(/.*)?)?$,) {
28 my @args = ("bug=$bug");
29 push @args, "msg=$msg" if (defined $msg);
32 } elsif ($rest eq "/mbox") {
33 push @args, "mbox=yes";
34 } elsif ($rest =~ m,^/att/(\d+)(/[^/]+)?$,) {
36 push @args, "filename=$2" if (defined $2);
41 { $ENV{"PATH"}="/bin"; exec "./bugreport.cgi", "leeturls=yes", @args; }
43 print "Content-Type: text/html; charset=utf-8\n\n";
44 print "<p>Couldn't execute bugreport.cgi!!";
49 if ($path =~ m,^/suite/([^/]*)(/.*)$,) {
50 $suite = $1; $path = $2;
51 } elsif ($path =~ m,^/arch/([^/]*)(/.*)$,) {
52 $arch = $1; $path = $2;
53 } elsif ($path =~ m,^/suite-arch/([^/]*)/([^/]*)(/.*)$,) {
54 $suite = $1; $arch = $2; $path = $3;
60 if ($path =~ m,^/(package|source|maint|submitter|severity|tag|user-tag)/([^/]+)(/(.*))?$,) {
61 $type = $1; $what = $2; $selection = $4 || "";
62 if ($selection ne "") {
63 unless ($type =~ m,^(package|source|user-tag)$,) {
67 my @what = split /,/, $what;
68 my @selection = split /,/, $selection;
70 $typearg = "pkg" if ($type eq "package");
71 $typearg = "src" if ($type eq "source");
74 push @args, $typearg . "=" . join(",", @what);
75 push @args, "version=" . join(",", @selection)
76 if ($type eq "package" and $#selection >= 0);
77 push @args, "utag=" . join(",", @selection)
78 if ($type eq "user-tag" and $#selection >= 0);
79 push @args, "arch=" . $arch if (defined $arch);
80 push @args, "suite=" . $suite if (defined $suite);
82 { $ENV{"PATH"}="/bin"; exec "./pkgreport.cgi", "leeturls=yes", @args }
84 print "Content-Type: text/html; charset=utf-8\n\n";
85 print "<p>Couldn't execute pkgreport.cgi!!";
93 print "Content-Type: text/html; charset=utf-8\n\n";
94 print "<p>Bad URL :(\n";