Catch patches attached via the web submission form (prior to the last update.)

This commit is contained in:
Shaun Amott 2008-01-26 15:53:55 +00:00
parent b035d48107
commit af21668f45
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=31370

View file

@ -26,7 +26,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: www/en/cgi/query-pr.cgi,v 1.62 2007/06/12 19:38:30 simon Exp $
# $FreeBSD: www/en/cgi/query-pr.cgi,v 1.63 2007/12/17 17:46:05 shaun Exp $
#
#
@ -96,6 +96,8 @@ my (%header, %sfields, %mfields);
my $iscgi = defined $ENV{'SCRIPT_NAME'};
my $fromwebform = 0;
$ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin";
$ENV{'QUERY_STRING'} ||= "";
@ -400,6 +402,9 @@ foreach my $line (@query)
$getpatch = 0 if ($getpatch < 0);
$fromwebform =
$header{'x-send-pr-version'} =~ /^www-/;
if ($getpatch > 0) {
extractpatch();
exit;
@ -1009,6 +1014,19 @@ sub parsepatches
return 1;
}
if (/^Patch attached with submission follows:$/ && $fromwebform && !$inpatch) {
$patchnum++;
$inpatch |= PATCH_ANY;
return 1 if ($getpatch and $patchnum != $getpatch);
$lastcol = undef;
$lastrev = undef;
sprint('patchblock_thead', $patchnum, 'patch.txt', "txt")
unless ($getpatch);
return 1;
}
if (/^---{1,8}\s?([A-Za-z0-9-_.,:%]+) (begins|starts) here/i && !$inpatch) {
$patchnum++;
$inpatch |= PATCH_ANY;