|
Lines 29-34
Link Here
|
| 29 |
# $FreeBSD: www/en/cgi/query-pr.cgi,v 1.61 2007/01/10 17:47:39 danger Exp $ |
29 |
# $FreeBSD: www/en/cgi/query-pr.cgi,v 1.61 2007/01/10 17:47:39 danger Exp $ |
| 30 |
# |
30 |
# |
| 31 |
|
31 |
|
|
|
32 |
# |
| 33 |
# Note: this is a script to run on a webserver. If you want to do tests |
| 34 |
# on the command-line, use the QUERY_STRING environment variable to |
| 35 |
# pass parameters to the script: |
| 36 |
# $ QUERY_STRING=pr=bin/106049 ./query-pr.cgi |
| 37 |
# |
| 38 |
|
| 32 |
use strict; |
39 |
use strict; |
| 33 |
|
40 |
|
| 34 |
use MIME::Base64; # ports/converters/p5-MIME-Base64 |
41 |
use MIME::Base64; # ports/converters/p5-MIME-Base64 |
|
Lines 39-45
Link Here
|
| 39 |
require './query-pr-lib.pl'; |
46 |
require './query-pr-lib.pl'; |
| 40 |
|
47 |
|
| 41 |
use constant HTTP_HEADER => "Content-type: text/html; charset=UTF-8\r\n\r\n"; |
48 |
use constant HTTP_HEADER => "Content-type: text/html; charset=UTF-8\r\n\r\n"; |
| 42 |
use constant HTTP_HEADER_PATCH => "Content-type: text/plain; charset=UTF-8\r\n\r\n"; |
49 |
use constant HTTP_HEADER_PATCH => "Content-type: text/plain; charset=UTF-8\r\nContent-Disposition: inline; filename=\"%s\"\r\n\r\n"; |
| 43 |
|
50 |
|
| 44 |
use constant SECT_HEADER => 1; |
51 |
use constant SECT_HEADER => 1; |
| 45 |
use constant SECT_SFIELDS => 2; |
52 |
use constant SECT_SFIELDS => 2; |
|
Lines 149-155
Link Here
|
| 149 |
$fmt{'patchblock_thead'} = <<EOF; |
156 |
$fmt{'patchblock_thead'} = <<EOF; |
| 150 |
<table class="patchblock" cellspacing="0" cellpadding="3"> |
157 |
<table class="patchblock" cellspacing="0" cellpadding="3"> |
| 151 |
<tr class="info"><td> |
158 |
<tr class="info"><td> |
| 152 |
<b>Download <a href="${scriptname}?pr=%%(pr)&getpatch=%%(1)">%%(2)</a></b> |
159 |
<b>Download <a href="${scriptname}?prp=%%(pr)-%%(1)">%%(2)</a></b> |
| 153 |
</td></tr> |
160 |
</td></tr> |
| 154 |
<tr><td class="content"><pre> |
161 |
<tr><td class="content"><pre> |
| 155 |
EOF |
162 |
EOF |
|
Lines 246-257
Link Here
|
| 246 |
$PR = lc $val if ($key eq "pr" or $key eq "q"); |
253 |
$PR = lc $val if ($key eq "pr" or $key eq "q"); |
| 247 |
$PR = lc $key if ($key =~ /^(?:$valid_category\/)?$valid_pr$/i); |
254 |
$PR = lc $key if ($key =~ /^(?:$valid_category\/)?$valid_pr$/i); |
| 248 |
$category = lc $val if ($key eq "cat"); |
255 |
$category = lc $val if ($key eq "cat"); |
| 249 |
$getpatch = lc $val if ($key eq "getpatch"); |
256 |
|
|
|
257 |
if ($key eq "prp") { |
| 258 |
$PR = lc ($val); |
| 259 |
$PR =~ s/\-.*$//; |
| 260 |
$getpatch = lc ($val); |
| 261 |
$getpatch =~ s/^.*\-//; |
| 262 |
} |
| 250 |
} |
263 |
} |
| 251 |
} |
264 |
} |
| 252 |
|
265 |
|
| 253 |
unless (!$iscgi) { |
266 |
unless (!$iscgi) { |
| 254 |
print HTTP_HEADER_PATCH if ($getpatch > 0 or $f eq "raw"); |
267 |
printf HTTP_HEADER_PATCH,"patch-$getpatch.diff" |
|
|
268 |
if ($getpatch > 0 or $f eq "raw"); |
| 255 |
} |
269 |
} |
| 256 |
|
270 |
|
| 257 |
($category, $PR) = ($1, $2) |
271 |
($category, $PR) = ($1, $2) |