diff options
author | j pipkin <j@dawnrazor.net> | 2013-09-20 13:56:07 -0500 |
---|---|---|
committer | j pipkin <j@dawnrazor.net> | 2013-09-20 13:56:07 -0500 |
commit | 7cbfb8f6aa04b0c6a6c6967c28fc514e164f251b (patch) | |
tree | 68c94bec8942e02b7c8caf520bedf8478bdf76bb /sboinstall | |
parent | 4f68deb678ee9e8c5116435459914120560bef49 (diff) | |
download | sbotools2-7cbfb8f6aa04b0c6a6c6967c28fc514e164f251b.tar.xz |
SBO-Lib/lib/SBO/Lib.pm, sboinstall, sboremove, sboupgrade: remove smartmatch
usage; t/test.t: remove smartmatch usage, fix bug where we were testing
@symlinks as though its contents would be in a specific order whereas actually
it is populated from a hash.
Diffstat (limited to 'sboinstall')
-rwxr-xr-x | sboinstall | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -111,26 +111,33 @@ s/::/-/g for @$pms; # check for already-installeds and prompt for the rest my (@temp_queue, %commands, %options); my $added = ' added to install queue.'; +my %inst_names; +$inst_names{$_} = 1 for @$inst_names; + FIRST: for my $sbo (@$build_queue) { my $name = $compat32 ? "$sbo-compat32" : $sbo; - if ($name ~~ @$inst_names) { - say "$name already installed."; - next FIRST; - } else { + + if ($inst_names{$name}) { + say "$name already installed."; + next FIRST; + } else { if ($sbo =~ /^perl-/) { my $pm_name = $sbo; $pm_name =~ s/^perl-//; - if (/^$pm_name$/i ~~ @$pms) { - say "$sbo installed via the cpan."; - next FIRST; + for my $pm (@$pms) { + if ($pm =~ /^$pm_name$/i) { + say "$sbo installed via the cpan."; + 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. if ($compat32) { - unless ($sbo ~~ @$inst_names) { + unless ($inst_names{$sbo}) { say "$name requires $sbo."; my ($cmds, $opts, $exit) = user_prompt($sbo, $locations{$sbo}); if ($exit) { |