commit ac919a733a5e7b27472d69b433447406310f2144
parent f211e8fd7f05d035f473056c4b1a63c617e472e3
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Thu, 21 Jul 2016 00:02:55 +0200
sboconfig: Just pass in all %changes to config_write()
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sboconfig b/sboconfig
@@ -135,6 +135,7 @@ sub config_write {
while (@_ >= 2) {
my $key = shift;
my $val = shift;
+ say "Setting $key to $val...";
if ($conf =~ /^\Q$key\E=/m) {
$conf =~ s/^\Q$key\E=.*$/$key=$val/m;
@@ -177,10 +178,6 @@ sub _fixup_conf {
$_[0] = join "\n", @fixed, ''; # make sure we end with a newline if there are any lines
}
-for my $key (keys %changes) {
- my $value = $changes{$key};
- say "Setting $key to $value...";
- config_write($key, $value);
-}
+config_write(%changes) if %changes;
exit 0;