diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-06-23 13:25:22 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-06-23 14:14:10 +0100 |
commit | 9e3287b0f9611af321b7cb1ca7b7757dbe96cfd2 (patch) | |
tree | 7bc8b1b8b9ac35970bf6c9f2d420745283d0f5a0 /Debian/Dgit/Policy/Debian.pm | |
parent | 399c708ec36a98ac6126ad0ae07991c111b095cb (diff) |
Dgit.pm: poldb_setup: Provide hook function
No users yet, so nfc.
Diffstat (limited to 'Debian/Dgit/Policy/Debian.pm')
-rw-r--r-- | Debian/Dgit/Policy/Debian.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Debian/Dgit/Policy/Debian.pm b/Debian/Dgit/Policy/Debian.pm index 03118b1..12f1ee1 100644 --- a/Debian/Dgit/Policy/Debian.pm +++ b/Debian/Dgit/Policy/Debian.pm @@ -27,12 +27,15 @@ sub poldb_path ($) { return "$repos/policy.sqlite3"; } -sub poldb_setup ($) { - my ($policydb) = @_; +sub poldb_setup ($;$) { + my ($policydb, $hook) = @_; $poldbh ||= DBI->connect("dbi:SQLite:$policydb",'','', { RaiseError=>1, PrintError=>1, AutoCommit=>0 }); + + $hook->() if $hook; + $poldbh->do("PRAGMA foreign_keys = ON"); } |