From ba923623a80877a6ba06e7fe528b480763ab9ddb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 11 May 2015 08:57:52 +0100 Subject: dgit-repos-policy-debian: Fix add_taint --- infra/dgit-repos-policy-debian | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'infra') 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 $!; $_ = ; + 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); } -- cgit v1.2.3