Commits

Palmer, 2E0EOL committed 1873fa0

Print errors and bail, when there are problems with the .ini file

Comments (0)

Files changed (1)

 
 diff -r 6f13f90aaaee debian/control
 --- a/debian/control	Wed Feb 20 23:52:19 2013 +0000
-+++ b/debian/control	Thu Feb 21 20:41:49 2013 +0000
++++ b/debian/control	Thu Feb 21 21:09:00 2013 +0000
 @@ -11,7 +11,7 @@
  Depends: ${shlibs:Depends}, ${misc:Depends},
   libwww-perl,
  Description: Podcast downloader and management system
 diff -r 6f13f90aaaee dlpodget
 --- a/dlpodget	Wed Feb 20 23:52:19 2013 +0000
-+++ b/dlpodget	Thu Feb 21 20:41:49 2013 +0000
-@@ -34,6 +34,7 @@
++++ b/dlpodget	Thu Feb 21 21:09:00 2013 +0000
+@@ -34,7 +34,7 @@
  use LWP::UserAgent;
  use XML::Feed;
  use Data::Dumper;
+-use Daybo::ConfReader;
 +use Config::IniFiles;
- use Daybo::ConfReader;
  use Getopt::Std;
  use URI::Escape;
-@@ -176,7 +177,6 @@
+ use IO::Interactive qw(is_interactive);
+@@ -176,7 +176,6 @@
  	my %feeds = ( );
  	my %opts = ( );
  	my %pids;
  	my @confFiles = (
  		'dlpodget.rc',
  		"$ENV{HOME}/.dlpodget.rc"
-@@ -186,16 +186,11 @@
+@@ -186,17 +185,17 @@
  	$Debug = 1 if ( $opts{'d'} );
  	print(STDERR "Explicit debug mode enabled by -d\n") if ( $Debug );
  
 -			$conf->Reload();
 -			$confSeen++;
 -			last;
--		}
-+		$conf = Config::IniFiles->new( -file => $confFile );
++		$conf = Config::IniFiles->new( -file => $confFile, -commentchar => ';', -default => '_main' );
++		if ( !$conf ) {
++			print(STDERR "Fault with $confFile: " . join(',', @Config::IniFiles::errors) . "\n");
++			return 1;
+ 		}
 +		last;
  	}
 -	$conf = undef if ( !$confSeen );
  
++	die Dumper $conf;
  	if ( $conf && $conf->GetKeys(undef, \@defKeys) ) {
  		if ( 'enable' ~~ @defKeys ) {
+ 			if ( !$conf->GetDatum(undef, 'enable') ) {