From 6be3dc2dd2767bab34cdf4699d8a8b2816595831 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Mon, 27 Jul 2009 23:38:24 +0200 Subject: [PATCH] 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. --- bin/wanna-build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.39.5