diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-07-04 14:31:57 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-07-04 14:31:57 -0500 |
commit | c6d5b112162c13c352ab327ed7ebf2c363798890 (patch) | |
tree | 427264d57ce4f847eb47d330c2863ccd47700899 | |
parent | 652adfab51a5a8481c8f08adc1415db9413b8d65 (diff) | |
download | sbotools2-c6d5b112162c13c352ab327ed7ebf2c363798890.tar.xz |
fixes for slack 13.37's perl 5.12
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 27e6eb7..382b221 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -87,7 +87,11 @@ if (-f $conf_file) { %conf_values = $text =~ /^(\w+)=(.*)$/mg; close $fh; } -$config{$_} = $conf_values{$_} for keys %config; + +for my $key (keys %config) { + $config{$key} = $conf_values{$key} if exists $conf_values{$key}; +} +#$config{$_} = $conf_values{$_} for keys %config; $config{JOBS} = 'FALSE' unless $config{JOBS} =~ /^\d+$/; $config{SBO_HOME} = '/usr/sbo' if $config{SBO_HOME} eq 'FALSE'; @@ -105,13 +109,13 @@ sub show_version { # %supported maps what's in /etc/slackware-version to what's at SBo sub get_slack_version { my %supported = ( - 13.37.0 => '13.37', - 14.0 => '13.37', + '13.37.0' => '13.37', + '14.0' => '13.37', ); my $fh = open_read ('/etc/slackware-version'); chomp (my $line = <$fh>); close $fh; - my $version = ($line =~ /\s+(\d+[^\s]+)$/)[0] + 0; + my $version = ($line =~ /\s+(\d+[^\s]+)$/)[0]; die "Unsupported Slackware version: $version\n" unless $version ~~ %supported; return $supported{$version}; |