diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-04-19 21:26:47 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-05-31 11:54:05 +0100 |
commit | 323e5e59ee548bf44cc2cb9a584cb1c3edcabe3f (patch) | |
tree | ee67cc6322666c2169647d5173f9640ca6a143ec /infra/dgit-repos-policy-debian | |
parent | 637c65f6a92e5a8436661ef0898079c0c0a104b0 (diff) |
New policy admin script
Diffstat (limited to 'infra/dgit-repos-policy-debian')
-rwxr-xr-x | infra/dgit-repos-policy-debian | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 7e459cc..fa1d17d 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -7,13 +7,13 @@ use JSON; use File::Temp; use Debian::Dgit qw(:DEFAULT :policyflags); +use Debian::Dgit::Policy::Debian; our $distro = shift @ARGV // die "need DISTRO"; our $repos = shift @ARGV // die "need DGIT-REPOS-DIR"; our $action = shift @ARGV // die "need ACTION"; our $publicmode = 02775; -our $policydb = "dbi:SQLite:$repos/policy.sqlite3"; our $new_upload_propagation_slop = 3600*4 + 100; our $poldbh; @@ -71,41 +71,6 @@ our %deliberately; # - .dsc of NEW dgit package has corresponding dgit-repo but not # publicly readable -sub poldb_setup () { - $poldbh ||= DBI->connect($policydb,'','', { - RaiseError=>1, PrintError=>1, AutoCommit=>0 - }); - $poldbh->do("PRAGMA foreign_keys = ON"); - - $poldbh->do(<<END); - CREATE TABLE IF NOT EXISTS taints ( - taint_id INTEGER NOT NULL PRIMARY KEY ASC AUTOINCREMENT, - package TEXT NOT NULL, - gitobjid TEXT NOT NULL, - comment TEXT NOT NULL, - time INTEGER, - gitobjtype TEXT, - gitobjdata TEXT - ) -END - $poldbh->do(<<END); - CREATE INDEX IF NOT EXISTS taints_by_package - ON taints (package, gitobject) -END - # any one of of the listed deliberatelies will override its taint - $poldbh->do(<<END); - CREATE TABLE IF NOT EXISTS taintoverrides ( - taint_id INTEGER NOT NULL - REFERENCES taints (taint_id) - ON UPDATE RESTRICT - ON DELETE CASCADE - DEFERRABLE INITIALLY DEFERRED, - deliberately TEXT NOT NULL, - PRIMARY KEY (taint_id, deliberately) - ) -END -} - sub apiquery ($) { my ($subpath) = @_; local $/=undef; @@ -391,7 +356,7 @@ if (!$fn) { my $sleepy=0; for (;;) { - poldb_setup(); + poldb_setup(poldb_path($repos)); $stderr = ''; my $rcode = $fn->(); |