Get a patch in plain text
git-svn-id: svn://10.0.0.236/trunk@137296 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
27
mozilla/webtools/tinderbox3/scripts/get_patch.pl
Executable file
27
mozilla/webtools/tinderbox3/scripts/get_patch.pl
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl -wT -I.
|
||||
|
||||
use CGI;
|
||||
use Tinderbox3::DB;
|
||||
use Tinderbox3::XML;
|
||||
my $p = new CGI();
|
||||
my $dbh = get_dbh();
|
||||
|
||||
my $patch_id = $p->param('patch_id') || "";
|
||||
if (!$patch_id) {
|
||||
die_xml_error($p, $dbh, "Must specify patch id!");
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Get data for response
|
||||
#
|
||||
my $patch = $dbh->selectrow_arrayref("SELECT patch FROM tbox_patch WHERE patch_id = ?", undef, $patch_id);
|
||||
if (!defined($patch)) {
|
||||
die_xml_error($p, $dbh, "Could not get tree!");
|
||||
}
|
||||
|
||||
print $p->header("text/plain");
|
||||
|
||||
print $patch->[0];
|
||||
|
||||
$dbh->disconnect;
|
||||
27
mozilla/webtools/tinderbox3/server/get_patch.pl
Executable file
27
mozilla/webtools/tinderbox3/server/get_patch.pl
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/perl -wT -I.
|
||||
|
||||
use CGI;
|
||||
use Tinderbox3::DB;
|
||||
use Tinderbox3::XML;
|
||||
my $p = new CGI();
|
||||
my $dbh = get_dbh();
|
||||
|
||||
my $patch_id = $p->param('patch_id') || "";
|
||||
if (!$patch_id) {
|
||||
die_xml_error($p, $dbh, "Must specify patch id!");
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Get data for response
|
||||
#
|
||||
my $patch = $dbh->selectrow_arrayref("SELECT patch FROM tbox_patch WHERE patch_id = ?", undef, $patch_id);
|
||||
if (!defined($patch)) {
|
||||
die_xml_error($p, $dbh, "Could not get tree!");
|
||||
}
|
||||
|
||||
print $p->header("text/plain");
|
||||
|
||||
print $patch->[0];
|
||||
|
||||
$dbh->disconnect;
|
||||
Reference in New Issue
Block a user