From: Ian Jackson Date: Tue, 23 Jun 2015 12:25:22 +0000 (+0100) Subject: Dgit.pm: poldb_setup: Provide hook function X-Git-Tag: debian/0.30~57 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=9e3287b0f9611af321b7cb1ca7b7757dbe96cfd2;ds=sidebyside Dgit.pm: poldb_setup: Provide hook function No users yet, so nfc. --- diff --git a/Debian/Dgit/Policy/Debian.pm b/Debian/Dgit/Policy/Debian.pm index 03118b1d..12f1ee11 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"); }