aboutsummaryrefslogtreecommitdiff
path: root/sboinstall
diff options
context:
space:
mode:
Diffstat (limited to 'sboinstall')
-rwxr-xr-xsboinstall20
1 files changed, 15 insertions, 5 deletions
diff --git a/sboinstall b/sboinstall
index b7dc536..50798d8 100755
--- a/sboinstall
+++ b/sboinstall
@@ -13,7 +13,7 @@
use 5.16.0;
use strict;
use warnings FATAL => 'all';
-use SBO::Lib qw/ %config _ERR_OPENFH get_arch get_build_queue get_installed_cpans get_installed_packages get_sbo_location get_sbo_locations merge_queues open_fh print_failures process_sbos prompt show_version slackbuilds_or_fetch slurp usage_error user_prompt /;
+use SBO::Lib qw/ %config _ERR_OPENFH get_arch get_build_queue get_installed_cpans get_installed_packages get_sbo_location get_sbo_locations in merge_queues open_fh print_failures process_sbos prompt show_version slackbuilds_or_fetch slurp usage_error user_prompt /;
use Getopt::Long qw(:config bundling);
use File::Basename;
use JSON::PP;
@@ -98,7 +98,7 @@ if ($compat32) {
# if we can't find SLACKBUILDS.TXT in $config{HOME}, prompt to fetch the tree
slackbuilds_or_fetch();
-my (%warnings, $build_queue, %locations, $template);
+my (%warnings, $build_queue, $template);
if (length $utemp) {
my $json = JSON::PP->new->latin1;
@@ -130,12 +130,13 @@ my %inst_names;
$inst_names{$_->{name}} = $_ for @$inst_pkgs;
# populate %locations and sanity check
-%locations = get_sbo_locations($build_queue);
+my %locations = get_sbo_locations($build_queue);
for my $sbo (@$build_queue) {
next if $inst_names{$sbo};
- usage_error("Unable to locate $sbo in the SlackBuilds.org tree.") unless
- $locations{$sbo};
+ if (not $locations{$sbo} and in(@ARGV, $sbo)) {
+ usage_error("Unable to locate $sbo in the SlackBuilds.org tree.")
+ }
if ($compat32) {
usage_error("-p|--compat32 is not supported with Perl SBos.")
if $locations{$sbo} =~ qr|/perl/[^/]+$|;
@@ -175,6 +176,15 @@ FIRST: for my $sbo (@$build_queue) {
}
}
+ # Make sure the slackbuild exists on SBo
+ if (defined $warnings{$sbo} and $warnings{$sbo} eq 'nonexistent') {
+ say "Unable to locate $sbo in the SlackBuilds.org tree.";
+ if (not $non_int) {
+ exit 0 unless prompt "Do you want to ignore it and continue?", default => 'no';
+ }
+ next FIRST;
+ }
+
$locations{$name} = get_sbo_location($sbo) if $compat32;
unless ($non_int) {
# if compat32 is TRUE, we need to see if the non-compat version exists.