aboutsummaryrefslogtreecommitdiff
path: root/sboinstall
diff options
context:
space:
mode:
Diffstat (limited to 'sboinstall')
-rwxr-xr-xsboinstall23
1 files changed, 18 insertions, 5 deletions
diff --git a/sboinstall b/sboinstall
index 56e682e..6bff012 100755
--- a/sboinstall
+++ b/sboinstall
@@ -64,7 +64,7 @@ GetOptions(
show_usage and exit 0 if $help;
show_version and exit 0 if $vers;
-show_usage and exit 0 unless exists $ARGV[0];
+show_usage and exit 1 unless exists $ARGV[0];
$noclean = $noclean eq 'TRUE' ? 1 : 0;
$distclean = $distclean eq 'TRUE' ? 1 : 0;
@@ -130,7 +130,11 @@ FIRST: for my $sbo (@$build_queue) {
if ($compat32) {
unless ($sbo ~~ @$inst_names) {
say "$name requires $sbo.";
- my ($cmds, $opts) = user_prompt($sbo, $locations{$sbo});
+ my ($cmds, $opts, $exit) = user_prompt($sbo, $locations{$sbo});
+ if ($exit) {
+ warn "Unable to open README for $sbo.\n";
+ exit $exit;
+ }
if ($cmds) {
next FIRST if $cmds eq 'N';
}
@@ -140,7 +144,11 @@ FIRST: for my $sbo (@$build_queue) {
say "$sbo$added";
}
}
- my ($cmds, $opts) = user_prompt($name, $locations{$name});
+ my ($cmds, $opts, $exit) = user_prompt($name, $locations{$name});
+ if ($exit) {
+ warn "Unable to open README for $name.\n";
+ exit $exit;
+ }
if ($cmds) {
next FIRST if $cmds eq 'N';
}
@@ -162,7 +170,7 @@ unless ($non_int) {
exit 0 unless <STDIN> =~ /^[Yy\n]/;
}
-my $failures = process_sbos(
+my ($failures, $exit) = process_sbos(
TODO => $build_queue,
CMDS => \%commands,
OPTS => \%options,
@@ -171,7 +179,12 @@ my $failures = process_sbos(
NOINSTALL => $no_install,
NOCLEAN => $noclean,
DISTCLEAN => $distclean,
+ NON_INT => $non_int,
);
print_failures($failures);
-exit keys %$failures > 0 ? 1 : 0;
+if ($exit) {
+ exit $exit;
+} else {
+ exit 0;
+}