# Try and load a config file first, and then allow the command line
# to override what is in the config file.
-my ($c);
+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/) {
+ if ($@) {
# Die on any issues loading the config file, apart from it not existing.
- die $@;
+ if ($@ =~ /^No config file found/) {
+ $c->{'config_file_loaded'} = 0;
+ } else {
+ die $@;
+ }
+ } else {
+ $c->{'config_file_loaded'} = 1;
}
}
}
if ($verbose) {
- print "Today: $today\n";
- print "Tomorrow: $tomorrow\n";
+ print "Today: $today\n";
+ print "Tomorrow: $tomorrow\n";
+ print "Config::Auto module: " . (defined $INC{'Config/Auto.pm'} ? 'Loaded' : 'Not Loaded') . "\n";
+ print "Config file loaded: " . ($c->{'config_file_loaded'} ? 'Yes' : 'No') . "\n";
}
# If we're in return code only mode then we disable all blocks
Eric Wilde
* Since a config file is optional, make Config::Auto optional.
+ Andrew Ruthven
+ * In verbose mode, show if Config::Auto is loaded and if we load a config
+ file, this is useful information for when I'm debugging issues.
+
-- Andrew Ruthven <andrew@etc.gen.nz> Mon, 12 Nov 2018 23:19:17 +1300
mythtv-status (0.10.8-1) unstable; urgency=low