diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-12-27 00:30:31 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-12-27 19:20:02 +0000 |
commit | c1d7a19f768fb94ff8d7eb02066b565ec7bfbd9e (patch) | |
tree | 72788cf393b83ab165a1e28d2af57ef8b7602057 /infra | |
parent | b1fc3bb4bae23b368a697c8eaeb82f68e66e1805 (diff) |
policy-client-query: implement tainted-objects query
Initial implementation, needs another feature to catch all the late
failures.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/dgit-repos-policy-debian | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 3722833..f110fa3 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -512,6 +512,29 @@ sub action_check_list () { return 0; } +sub polclqu_tainted_objects () { + print STDERR "1 $pkg "; + my $topq = $poldbh->selectall_arrayref(<<END, + SELECT taint_id, gitobjtype, gitobjid, time, comment + FROM taints + WHERE package = ? +END + { Slice => {} }, + $pkg); + foreach my $row (@$topq) { + my $delibs = $poldbh->selectall_arrayref(<<END, + SELECT deliberately + FROM taintoverrides + WHERE taint_id = ? +END + { }, + $row->{taint_id}); + $row->{overrides} = [ map { $_->[0] } @$delibs ]; + delete $row->{taint_id}; + } + print encode_json $topq, "\n" or die $!; +} + my $fn_name; if ($action eq 'policy-client-query') { |