chiark / gitweb /
Dgit.pm: poldb_setup: Provide hook function
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 23 Jun 2015 12:25:22 +0000 (13:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 23 Jun 2015 13:14:10 +0000 (14:14 +0100)
No users yet, so nfc.

Debian/Dgit/Policy/Debian.pm

index 03118b1..12f1ee1 100644 (file)
@@ -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");
 }