From bf927b318029e59ba66d2b745a66f3482d09a5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 2 Mar 2011 15:17:03 +0000 Subject: [PATCH] Set a default value for `getHydraPath'. --- configure.ac | 1 + src/lib/Hydra/Helper/{Nix.pm => Nix.pm.in} | 4 +--- src/lib/Makefile.am | 21 ++++++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) rename src/lib/Hydra/Helper/{Nix.pm => Nix.pm.in} (97%) diff --git a/configure.ac b/configure.ac index a7c8e31e..07637642 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,7 @@ AC_CONFIG_FILES([ src/sql/Makefile src/xsl/Makefile src/lib/Makefile + src/lib/Hydra/Helper/Nix.pm src/root/Makefile src/script/Makefile diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm.in similarity index 97% rename from src/lib/Hydra/Helper/Nix.pm rename to src/lib/Hydra/Helper/Nix.pm.in index 8cf970cf..59137f16 100644 --- a/src/lib/Hydra/Helper/Nix.pm +++ b/src/lib/Hydra/Helper/Nix.pm.in @@ -24,9 +24,7 @@ sub isValidPath { sub getHydraPath { - my $dir = $ENV{"HYDRA_DATA"}; - die "The HYDRA_DATA environment variable is not set!\n" unless defined $dir; - die "The HYDRA_DATA directory does not exist!\n" unless -d $dir; + my $dir = $ENV{"HYDRA_DATA"} || "@localstatedir@/lib/hydra"; return $dir; } diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 3fd1f265..fa60f320 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -1,12 +1,15 @@ -PERL_MODULES = \ - $(wildcard *.pm) \ - $(wildcard Hydra/*.pm) \ - $(wildcard Hydra/Helper/*.pm) \ - $(wildcard Hydra/Model/*.pm) \ - $(wildcard Hydra/View/*.pm) \ - $(wildcard Hydra/Schema/*.pm) \ - $(wildcard Hydra/Controller/*.pm) \ - $(wildcard Hydra/Base/*.pm) \ +PERL_MODULES = \ + $(wildcard *.pm) \ + $(wildcard Hydra/*.pm) \ + Hydra/Helper/AddBuilds.pm \ + Hydra/Helper/CatalystUtils.pm \ + Hydra/Helper/Nix.pm.in \ + $(wildcard Hydra/Helper/*.pm) \ + $(wildcard Hydra/Model/*.pm) \ + $(wildcard Hydra/View/*.pm) \ + $(wildcard Hydra/Schema/*.pm) \ + $(wildcard Hydra/Controller/*.pm) \ + $(wildcard Hydra/Base/*.pm) \ $(wildcard Hydra/Base/Controller/*.pm) EXTRA_DIST = $(PERL_MODULES)