From e4b7198845771dbfc3fadbbe6c7f382dbb905e02 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Tue, 27 Feb 2018 14:49:38 -0800 Subject: [PATCH] allow debbugs-installsql to take a --dsn option --- bin/debbugs-installsql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/debbugs-installsql b/bin/debbugs-installsql index 892aef4..5957acb 100755 --- a/bin/debbugs-installsql +++ b/bin/debbugs-installsql @@ -83,6 +83,7 @@ my %options = (debug => 0, GetOptions(\%options, 'service|s=s', + 'dsn=s', 'sysconfdir|c=s', 'install', 'install_version_storage|install-version-storage', @@ -120,8 +121,14 @@ if (exists $options{sysconfdir}) { } } +if (not exists $options{dsn} or + not defined $options{dsn} or + not length $options{dsn}) { + $options{dsn} = 'dbi:Pg:service='.$options{service}; +} + -my $schema = Debbugs::DB->connect('dbi:Pg:service='.$options{service}) or +my $schema = Debbugs::DB->connect($options{dsn}) or die "Unable to connect to database"; -- 2.39.2