sbotools2

Maintenance fork of the original sbotools version 2
Log | Files | Refs | README

commit 695f85104c7e8b5d78b779276bfeb033ce8682ad
parent fa77a6fc7cc9e4a4e6767d517810e61a84ab65ce
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Sat, 23 Apr 2016 20:56:59 +0200

SBO::Lib: get_sbo_location(s)? check args better

Diffstat:
MSBO-Lib/lib/SBO/Lib.pm | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm @@ -457,8 +457,8 @@ sub get_inst_names { my %orig; sub get_sbo_location { - script_error('get_sbo_location requires an argument.') unless @_; - my @sbos = ref $_[0] eq 'ARRAY' ? @{ $_[0] } : @_; + my @sbos = defined $_[0] && ref $_[0] eq 'ARRAY' ? @{ $_[0] } : @_; + script_error('get_sbo_location requires an argument.') unless @sbos; # if we already have the location, return it now. return $$store{$sbos[0]} if exists $$store{$sbos[0]}; @@ -467,9 +467,8 @@ sub get_sbo_location { } sub get_sbo_locations { + my @sbos = defined $_[0] && ref $_[0] eq 'ARRAY' ? @{ $_[0] } : @_; script_error('get_sbo_locations requires an argument.') unless @_; - my @sbos = @_; - @sbos = @{ $sbos[0] } if ref $sbos[0] eq 'ARRAY'; my %locations; my ($fh, $exit) = open_read($slackbuilds_txt);