From 62b6156406606a18e9cdbc4fdc52bedae4f21835 Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Mon, 5 Nov 2012 03:19:39 -0600 Subject: git rid of prototype for open_fh. all tests pass. --- sboconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sboconfig') diff --git a/sboconfig b/sboconfig index 892279c..f969cbd 100755 --- a/sboconfig +++ b/sboconfig @@ -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; } -- cgit v1.2.3 From 333aeb20abc623bb3badae4b09ca8a78bfa2360e Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Mon, 5 Nov 2012 04:05:26 -0600 Subject: get rid of prototype for config_write. all tests pass --- sboconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sboconfig') diff --git a/sboconfig b/sboconfig index f969cbd..cfa8921 100755 --- a/sboconfig +++ b/sboconfig @@ -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) { @@ -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; -- cgit v1.2.3 From c8c2c477d4bdaf1e11e2a7a64dc5e453e132ac08 Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Fri, 30 Nov 2012 09:18:31 -0600 Subject: shared credit --- sboconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sboconfig') diff --git a/sboconfig b/sboconfig index cfa8921..71d9d91 100755 --- a/sboconfig +++ b/sboconfig @@ -5,7 +5,8 @@ # sboconfig # script to handle sbotools configuration # -# author: Jacob Pipkin +# authors: Jacob Pipkin +# Luke Williams # license: WTFPL use 5.16.0; -- cgit v1.2.3