summaryrefslogtreecommitdiff
path: root/Debian/Dgit/Policy/Debian.pm
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-04-19 21:26:47 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 11:54:05 +0100
commit323e5e59ee548bf44cc2cb9a584cb1c3edcabe3f (patch)
treeee67cc6322666c2169647d5173f9640ca6a143ec /Debian/Dgit/Policy/Debian.pm
parent637c65f6a92e5a8436661ef0898079c0c0a104b0 (diff)
New policy admin script
Diffstat (limited to 'Debian/Dgit/Policy/Debian.pm')
-rw-r--r--Debian/Dgit/Policy/Debian.pm39
1 files changed, 39 insertions, 0 deletions
diff --git a/Debian/Dgit/Policy/Debian.pm b/Debian/Dgit/Policy/Debian.pm
new file mode 100644
index 0000000..03118b1
--- /dev/null
+++ b/Debian/Dgit/Policy/Debian.pm
@@ -0,0 +1,39 @@
+# -*- perl -*-
+
+package Debian::Dgit::Policy::Debian;
+
+use strict;
+use warnings;
+
+use POSIX;
+
+BEGIN {
+ use Exporter ();
+ our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+
+ $VERSION = 1.00;
+ @ISA = qw(Exporter);
+ @EXPORT = qw(poldb_path poldb_setup $poldbh);
+ %EXPORT_TAGS = ( );
+ @EXPORT_OK = qw();
+}
+
+our @EXPORT_OK;
+
+our $poldbh;
+
+sub poldb_path ($) {
+ my ($repos) = @_;
+ return "$repos/policy.sqlite3";
+}
+
+sub poldb_setup ($) {
+ my ($policydb) = @_;
+
+ $poldbh ||= DBI->connect("dbi:SQLite:$policydb",'','', {
+ RaiseError=>1, PrintError=>1, AutoCommit=>0
+ });
+ $poldbh->do("PRAGMA foreign_keys = ON");
+}
+
+1;