diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-11-25 13:17:54 -0600 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-11-25 13:17:54 -0600 |
commit | de8bc8f56ec5df0300b21a5dd591c68d21879cf3 (patch) | |
tree | 3463d289095495157efb9a467bb43328ccfee87a | |
parent | 4ad6712b387f422dcf1cea9e85253ef491424462 (diff) | |
download | sbotools2-de8bc8f56ec5df0300b21a5dd591c68d21879cf3.tar.xz |
cleanup of user_prompt
-rwxr-xr-x | sboupgradex | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sboupgradex b/sboupgradex index f91995b..3d5a5bc 100755 --- a/sboupgradex +++ b/sboupgradex @@ -154,26 +154,26 @@ sub ask_opts ($) { } sub user_prompt { - exists $_[1] or script_error 'user_prompt requires two arguments.'; - my ($sbo, $location) = @_; - my $fh = open_read ($location .'/README'); - my $readme = do {local $/; <$fh>}; - close $fh; - - # check for user/group add commands, offer to run any found - my $user_group = get_user_group $readme; - my $cmds; - $cmds = ask_user_group ($user_group, $readme) if $$user_group[0]; - $commands{"$sbo"}=$cmds if defined $cmds; - # check for options mentioned in the README - my $opts = 0; - $opts = ask_opts $readme if get_opts $readme; - print "\n". $readme unless $opts; - $options{$sbo} = $opts if $opts; - - print "\nProceed with $sbo? [y]: "; - return 0 unless <STDIN> =~ /^[Yy\n]/; - return 1; + exists $_[1] or script_error 'user_prompt requires two arguments.'; + my ($sbo, $location) = @_; + my $fh = open_read ($location .'/README'); + my $readme = do {local $/; <$fh>}; + close $fh; + + # check for user/group add commands, offer to run any found + my $user_group = get_user_group $readme; + my $cmds; + $cmds = ask_user_group ($user_group, $readme) if $$user_group[0]; + $commands{$sbo} = $cmds if defined $cmds; + # check for options mentioned in the README + my $opts = 0; + $opts = ask_opts $readme if get_opts $readme; + print "\n". $readme unless $opts; + $options{$sbo} = $opts if $opts; + + print "\nProceed with $sbo? [y]: "; + return 0 unless <STDIN> =~ /^[Yy\n]/; + return 1; } # do the things with the provided sbos - whether upgrades or new installs. |