From: Eric Wilde Date: Mon, 12 Nov 2018 10:20:45 +0000 (+1300) Subject: Make Config::Auto an optional module. X-Git-Tag: 1.0.0~67 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19f112c912c826a86ed96fc5b519397fea40991c;p=mythtv-status.git Make Config::Auto an optional module. --- diff --git a/bin/mythtv-status b/bin/mythtv-status index 754eb38..10aff76 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -26,20 +26,22 @@ use POSIX qw/strftime :sys_wait_h/; use MIME::Entity; use Pod::Usage; -use Config::Auto; use Sys::SigAction qw/timeout_call/; use Encode; # Try and load a config file first, and then allow the command line -# to over ride what is in the config file. -my $c = eval { - Config::Auto::parse("mythtv-status.yml", - format => 'yaml', - ) -}; -if ($@ && $@ !~ /^No config file found/) { - # Die on any issues loading the config file, apart from it not existing. - die $@; +# to override what is in the config file. +my ($c); + +if (eval("{ local \$SIG{__DIE__}; require Config::Auto; }")) { + $c = eval { + Config::Auto::parse("mythtv-status.yml", format => 'yaml') + }; + + if ($@ && $@ !~ /^No config file found/) { + # Die on any issues loading the config file, apart from it not existing. + die $@; + } } # Some sane defaults.