diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-11-16 22:22:02 -0600 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-11-16 22:22:02 -0600 |
commit | 3d5dd514a8f536e7747783a0f52e1da19a20eb8d (patch) | |
tree | 8505aede4f7a82200b2b37872bf1ec17916032f0 /sboconfig | |
parent | 167298b834386219c491d70c87af7a2130b09e39 (diff) | |
parent | 51b62ac5d35bc6a8987dd34ab896a0308a49dec4 (diff) | |
download | sbotools2-3d5dd514a8f536e7747783a0f52e1da19a20eb8d.tar.xz |
testing branch git-merge'd
Diffstat (limited to 'sboconfig')
-rwxr-xr-x | sboconfig | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -105,7 +105,7 @@ if (exists $changes{SBO_HOME}) { # TODO: if multiple options are provided to this script, this sub should write # them all at once, instead of only a single one and having to call it once for # each option specified to the script. -sub config_write ($$) { +sub config_write { exists $_[1] or script_error 'config_write requires two arguments.'; my ($key, $val) = @_; if (! -d $conf_dir) { @@ -131,13 +131,13 @@ sub config_write ($$) { seek $tempfh, 0, 0; my $contents = do {local $/; <$tempfh>}; close $conffh; - eval { $conffh = open_fh $conf_file, '>' }; + eval { $conffh = open_fh ($conf_file, '>') }; warn "Cannot write configuration: $@\n" and return if $@; print {$conffh} $contents or return; close $conffh, close $tempfh; } else { # no config file, easiest case of all. - my $fh = open_fh $conf_file, '>' or return; + my $fh = open_fh ($conf_file, '>') or return; print {$fh} "$key=$val\n"; close $fh; } @@ -146,7 +146,7 @@ sub config_write ($$) { while (my ($key, $value) = each %changes) { say "Setting $key to $value..."; - config_write $key, $value or warn "Unable to write to $conf_file\n"; + config_write ($key, $value) or warn "Unable to write to $conf_file\n"; } exit 0; |