diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-11-30 02:29:03 -0600 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-11-30 02:29:03 -0600 |
commit | faac7d812d12fde07338b7878db04e297fdb2540 (patch) | |
tree | 3ac215d5262126ddc702a00947d86e55ceea7f57 | |
parent | ac21b44d8440a42a91df093a252ec04641679bbd (diff) | |
download | sbotools2-faac7d812d12fde07338b7878db04e297fdb2540.tar.xz |
die as we used to if a provided sbo doesnt exist, say the sbos name when asking about options
-rwxr-xr-x | sboupgrade | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -92,6 +92,8 @@ if ($no_reqs or $non_int) { } for my $sbo (@$build_queue) { $locations{$sbo} = get_sbo_location ($sbo); + die "Unable to location $sbo in the SlackBuilds.org tree.\n" unless + defined $locations{$sbo}; } sub get_readme_path ($) { @@ -128,11 +130,11 @@ sub get_opts ($) { } # provide an opportunity to set options -sub ask_opts ($) { +sub ask_opts { exists $_[0] or script_error 'ask_opts requires an argument'; - my $readme = shift; + my ($sbo, $readme) = @_; say "\n". $readme; - print "\nIt looks this slackbuild has options; would you like to set any"; + print "\nIt looks $sbo has options; would you like to set any"; print ' when the slackbuild is run? [n] '; if (<STDIN> =~ /^[Yy]/) { my $ask = sub () { @@ -167,7 +169,7 @@ sub user_prompt { $commands{$sbo} = $cmds if defined $cmds; # check for options mentioned in the README my $opts = 0; - $opts = ask_opts $readme if get_opts $readme; + $opts = ask_opts ($sbo, $readme) if get_opts $readme; print "\n". $readme unless $opts; $options{$sbo} = $opts if $opts; |