]> git.donarmstrong.com Git - debbugs.git/commitdiff
move bugs-fetch
authorDon Armstrong <don@donarmstrong.com>
Fri, 15 Aug 2008 22:01:37 +0000 (15:01 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 15 Aug 2008 22:01:37 +0000 (15:01 -0700)
cgi/bugs-fetch2.pl [new file with mode: 0644]
cgi/bugs-fetch2.pl.in [deleted file]

diff --git a/cgi/bugs-fetch2.pl b/cgi/bugs-fetch2.pl
new file mode 100644 (file)
index 0000000..496c092
--- /dev/null
@@ -0,0 +1,72 @@
+#!/usr/bin/perl
+
+require './common.pl';
+
+require '/etc/debbugs/config';
+
+%map= ($gMirrors);
+
+my %in = readparse();
+
+if ($in{'type'} eq 'ref') {
+    $_= $in{'ref'};
+    s/^\s+//; s/^\#//; s/^\s+//; s/^0*//; s/\s+$//;
+
+    if (m/\D/ || !m/\d/) {
+        print <<END;
+Content-Type: text/html
+
+<html><head><title>Bug number not numeric</title>
+</head><body>
+<h1>Invalid input to specific bug fetch form</h1>
+
+You must type a number, being the bug reference number.
+There should be no nondigits in your entry.
+</html>
+END
+        exit(0);
+    }
+    $suburl= "bugreport.cgi?bug=$_";
+} elsif ($in{'type'} eq 'package') {
+    $_= $in{'package'};
+    s/^\s+//; s/\s+$//; y/A-Z/a-z/;
+    if (m/^[^0-9a-z]/ || m/[^-+.0-9a-z]/) {
+        print <<END;
+Content-Type: text/html
+
+<html><head><title>Package name contains invalid characters</title>
+</head><body>
+<h1>Invalid input to package buglist fetch form</h1>
+
+You must type a package name.  Package names start with a letter
+or digit and contain only letters, digits and the characters
+- + . (hyphen, plus, full stop).
+</html>
+END
+        exit(0);
+    }
+    $suburl= "pkgreport.cgi?pkg=$_";
+} else {
+    print <<END;
+Content-Type: text/plain
+
+Please use the real DBC_WHO form. (invalid type value)
+END
+    exit(0);
+}
+
+$base= $gCGIDomain;
+
+$newurl= "http://$base/$suburl";
+print <<END;
+Status: 301 Redirect
+Location: $newurl
+
+The bug report data you are looking for ($suburl)
+is available <A href="$newurl">here</A>.
+
+(If this link does not work then the bug or package does not exist in
+the tracking system any more, or does not yet, or never did.)
+END
+
+exit(0);
diff --git a/cgi/bugs-fetch2.pl.in b/cgi/bugs-fetch2.pl.in
deleted file mode 100644 (file)
index 496c092..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/perl
-
-require './common.pl';
-
-require '/etc/debbugs/config';
-
-%map= ($gMirrors);
-
-my %in = readparse();
-
-if ($in{'type'} eq 'ref') {
-    $_= $in{'ref'};
-    s/^\s+//; s/^\#//; s/^\s+//; s/^0*//; s/\s+$//;
-
-    if (m/\D/ || !m/\d/) {
-        print <<END;
-Content-Type: text/html
-
-<html><head><title>Bug number not numeric</title>
-</head><body>
-<h1>Invalid input to specific bug fetch form</h1>
-
-You must type a number, being the bug reference number.
-There should be no nondigits in your entry.
-</html>
-END
-        exit(0);
-    }
-    $suburl= "bugreport.cgi?bug=$_";
-} elsif ($in{'type'} eq 'package') {
-    $_= $in{'package'};
-    s/^\s+//; s/\s+$//; y/A-Z/a-z/;
-    if (m/^[^0-9a-z]/ || m/[^-+.0-9a-z]/) {
-        print <<END;
-Content-Type: text/html
-
-<html><head><title>Package name contains invalid characters</title>
-</head><body>
-<h1>Invalid input to package buglist fetch form</h1>
-
-You must type a package name.  Package names start with a letter
-or digit and contain only letters, digits and the characters
-- + . (hyphen, plus, full stop).
-</html>
-END
-        exit(0);
-    }
-    $suburl= "pkgreport.cgi?pkg=$_";
-} else {
-    print <<END;
-Content-Type: text/plain
-
-Please use the real DBC_WHO form. (invalid type value)
-END
-    exit(0);
-}
-
-$base= $gCGIDomain;
-
-$newurl= "http://$base/$suburl";
-print <<END;
-Status: 301 Redirect
-Location: $newurl
-
-The bug report data you are looking for ($suburl)
-is available <A href="$newurl">here</A>.
-
-(If this link does not work then the bug or package does not exist in
-the tracking system any more, or does not yet, or never did.)
-END
-
-exit(0);