From a509694220789bb0674f8ab4210a448057df7e4c Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 29 Apr 2009 11:07:46 +0000 Subject: [PATCH] Hydra now uses an optional HYDRA_DBI environment variable which holds the DBI url. If this variable is not set, sqlite is used like before. --- src/lib/Hydra/Helper/Nix.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm index 321e874a..c758bd91 100644 --- a/src/lib/Hydra/Helper/Nix.pm +++ b/src/lib/Hydra/Helper/Nix.pm @@ -65,9 +65,15 @@ sub getHydraPath { sub getHydraDBPath { - my $path = getHydraPath . '/hydra.sqlite'; - die "The Hydra database ($path) not exist!\n" unless -f $path; - return "dbi:SQLite:$path"; + my $db = $ENV{"HYDRA_DBI"}; + if ($db ne "") { + return $db ; + } + else { + my $path = getHydraPath . '/hydra.sqlite'; + die "The Hydra database ($path) not exist!\n" unless -f $path; + return "dbi:SQLite:$path"; + } }