Used to notify when a build has been deleted (deletes corresponding build_fields from the DB)

This commit is contained in:
johnkeis 2003-02-04 09:44:53 +00:00
parent e99d878a12
commit 786726c527
2 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,36 @@
#!/usr/bin/perl -wT -I..
use strict;
use CGI;
use Tinderbox3::DB;
use Tinderbox3::XML;
use Tinderbox3::Log;
our $p = new CGI();
our $dbh = get_dbh();
$SIG{__DIE__} = sub { die_xml_error($p, $dbh, $_[0]); };
my $url = $p->param('url') || "";
if (!$url) {
die_xml_error($p, $dbh, "Must specify url!");
}
my $rows = $dbh->do("DELETE FROM tbox_build_field WHERE name = ? AND value = ?", undef, "build_zip", $url);
$dbh->commit;
if ($rows eq "0E0") {
die_xml_error($p, $dbh, "No rows deleted!");
}
#
# Print response
#
print $p->header("text/xml");
print "<response>\n";
print "<builds_deleted rows='$rows'/>\n";
print "</response>\n";
$dbh->disconnect;

View File

@ -0,0 +1,36 @@
#!/usr/bin/perl -wT -I..
use strict;
use CGI;
use Tinderbox3::DB;
use Tinderbox3::XML;
use Tinderbox3::Log;
our $p = new CGI();
our $dbh = get_dbh();
$SIG{__DIE__} = sub { die_xml_error($p, $dbh, $_[0]); };
my $url = $p->param('url') || "";
if (!$url) {
die_xml_error($p, $dbh, "Must specify url!");
}
my $rows = $dbh->do("DELETE FROM tbox_build_field WHERE name = ? AND value = ?", undef, "build_zip", $url);
$dbh->commit;
if ($rows eq "0E0") {
die_xml_error($p, $dbh, "No rows deleted!");
}
#
# Print response
#
print $p->header("text/xml");
print "<response>\n";
print "<builds_deleted rows='$rows'/>\n";
print "</response>\n";
$dbh->disconnect;