#!/usr/bin/perl use strict; use warnings; use CGI qw/:standard/; # File: uploadpatch.cgi # Author: Ben Hearsum # Description: # This cgi script displays a simple form that allows a user to submit a diff # that will eventually be uploaded to a Buildbot installation. # Along with the patch this script generates a .info file that contains the # name of the submitter, as read from $ENV['REMOTE_USER'], the date, in unix # time, the name of the patchfile, and the description read from the form. # This information is used by the download script to generate the # 'buildbot sendchange' command. # where the patches will go after being submitted my $PATCH_DIR = '/buildbot/patches'; # the size limit for the file, in bytes # 10*1024*1024 is 10MB my $SIZE_LIMIT = 10*1024*1024; # the URL to the buildbot installation the patches will eventually go to my $BUILDBOT_URL = 'http://localhost:8010'; # the URL to the uploadpatch.cgi script my $UPLOADPATCH_URL = 'http://localhost/cgi-bin/uploadpatch.cgi'; $CGI::POST_MAX = $SIZE_LIMIT; sub WriteSuccessPage { print "Content-type: text/html\n\n"; print <<__END_OF_HTML__;
Note: Uploaded files must be less than ${limit}kB
__END_OF_HTML__ if ($err) { print "$err
"; } print "