From: Joachim Breitner Date: Mon, 27 Jul 2009 21:38:24 +0000 (+0200) Subject: Make config prepopulateable X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6be3dc2dd2767bab34cdf4699d8a8b2816595831;p=wannabuild.git Make config prepopulateable To be able to write unit tests for wanna-build, make sure that we can fill out config variables before running the script. --- diff --git a/bin/wanna-build b/bin/wanna-build index 2f3cfd6..74770b5 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -21,10 +21,10 @@ package conf; # defaults -$basedir = "/var/lib/debbuild"; -$dbbase = "build-db"; -$transactlog = "transactions.log"; -$mailprog = "/usr/sbin/sendmail"; +$basedir ||= "/var/lib/debbuild"; +$dbbase ||= "build-db"; +$transactlog ||= "transactions.log"; +$mailprog ||= "/usr/sbin/sendmail"; require "/etc/wanna-build.conf"; die "$conf::basedir is not a directory\n" if ! -d $conf::basedir; die "dbbase is empty\n" if ! $dbbase;