summaryrefslogtreecommitdiff
path: root/infra/dgit-repos-policy-debian
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-11 08:57:52 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 11:54:11 +0100
commitba923623a80877a6ba06e7fe528b480763ab9ddb (patch)
tree6f343367b143a946938a329fb26cef5fd26bc369 /infra/dgit-repos-policy-debian
parent2ed034f34fe81fcdb2232d8d7a5e7c02dcb091dd (diff)
dgit-repos-policy-debian: Fix add_taint
Diffstat (limited to 'infra/dgit-repos-policy-debian')
-rwxr-xr-xinfra/dgit-repos-policy-debian15
1 files changed, 11 insertions, 4 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian
index ac42712..b25a560 100755
--- a/infra/dgit-repos-policy-debian
+++ b/infra/dgit-repos-policy-debian
@@ -150,21 +150,28 @@ sub getpackage () {
}
sub add_taint ($$) {
- my ($refobj, $reason);
+ my ($refobj, $reason) = @_;
+
+ printdebug "TAINTING $refobj\n",
+ (map { "\%| $_" } split "\n", $reason),
+ "\n";
my $tf = new File::Temp or die $!;
print $tf "$refobj^0\n" or die $!;
+ flush $tf or die $!;
+ seek $tf,0,0 or die $!;
my $gcfpid = open GCF, "-|";
defined $gcfpid or die $!;
if (!$gcfpid) {
open STDIN, "<&", $tf or die $!;
- exec 'git', 'cat-file';
+ exec 'git', 'cat-file', '--batch';
die $!;
}
close $tf or die $!;
$_ = <GCF>;
+ defined $_ or die;
m/^(\w+) (\w+) (\d+)\n/ or die "$_ ?";
my $gitobjid = $1;
my $gitobjtype = $2;
@@ -178,7 +185,7 @@ sub add_taint ($$) {
close GCF;
$poldbh->do("INSERT INTO taints".
- " (package, gitobjid, gitobjtype, gitobjdata, time, comment)",
+ " (package, gitobjid, gitobjtype, gitobjdata, time, comment)".
" VALUES (?,?,?,?,?,?)", {},
$pkg, $gitobjid, $gitobjtype, $gitobjdata, time, $reason);
@@ -186,7 +193,7 @@ sub add_taint ($$) {
die unless defined $taint_id;
$poldbh->do("INSERT INTO taintoverrides".
- " (taint_id, deliberately)",
+ " (taint_id, deliberately)".
" VALUES (?, 'include-questionable-history')", {},
$taint_id);
}