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};
22 if ($path =~ m,^/(\d+)(/(\d+)(/.*)?)?$,) {
27 my @args = ("bug=$bug");
28 push @args, "msg=$msg" if (defined $msg);
31 } elsif ($rest eq "/mbox") {
32 push @args, "mbox=yes";
33 } elsif ($rest =~ m,^/att/(\d+)(/[^/]+)?$,) {
35 push @args, "filename=$2" if (defined $2);
40 { $ENV{"PATH"}="/bin"; exec "./bugreport.cgi", "leeturls=yes", @args; }
42 print "Content-Type: text/html; charset=utf-8\n\n";
43 print "<p>Couldn't execute bugreport.cgi!!";
48 if ($path =~ m,^/suite/([^/]*)(/.*)$,) {
49 $suite = $1; $path = $2;
50 } elsif ($path =~ m,^/arch/([^/]*)(/.*)$,) {
51 $arch = $1; $path = $2;
52 } elsif ($path =~ m,^/suite-arch/([^/]*)/([^/]*)(/.*)$,) {
53 $suite = $1; $arch = $2; $path = $3;
59 if ($path =~ m,^/(package|source|maint|submitter|severity|tag|user-tag)/([^/]+)(/(.*))?$,) {
60 $type = $1; $what = $2; $selection = $4 || "";
61 if ($selection ne "") {
62 unless ($type =~ m,^(package|source|user-tag)$,) {
66 my @what = split /,/, $what;
67 my @selection = split /,/, $selection;
69 $typearg = "pkg" if ($type eq "package");
70 $typearg = "src" if ($type eq "source");
73 push @args, $typearg . "=" . join(",", @what);
74 push @args, "version=" . join(",", @selection)
75 if ($type eq "package" and $#selection >= 0);
76 push @args, "utag=" . join(",", @selection)
77 if ($type eq "user-tag" and $#selection >= 0);
78 push @args, "arch=" . $arch if (defined $arch);
79 push @args, "suite=" . $suite if (defined $suite);
81 { $ENV{"PATH"}="/bin"; exec "./pkgreport.cgi", "leeturls=yes", @args }
83 print "Content-Type: text/html; charset=utf-8\n\n";
84 print "<p>Couldn't execute pkgreport.cgi!!";
92 print "Content-Type: text/html; charset=utf-8\n\n";
93 print "<p>Bad URL :(\n";