sbotools2

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

commit e703434bcbe3c11ecae9c710241516d1c7fdebec
parent e8759a987a0bd1560cddd5d9443a4dfa2c3154fb
Author: J Pipkin <j@dawnrazor.net>
Date:   Sat,  9 Mar 2013 03:23:27 -0600

Merge branch 'nonexistent', fixes #51

Diffstat:
MSBO-Lib/lib/SBO/Lib.pm | 4++--
Msboinstall | 2+-
Msboupgrade | 2+-
Mt/test.t | 2+-
4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm @@ -326,7 +326,7 @@ sub get_sbo_location { seek $fh, 0, 0; } close $fh; - return keys %locations > 0 ? %locations : undef; + return %locations; } # pull the sbo name from a $location: $config{SBO_HOME}/system/wine, etc. @@ -383,7 +383,7 @@ sub get_available_updates() { FIRST: for my $key (keys @$pkg_list) { my $location = get_sbo_location($$pkg_list[$key]{name}); # if we can't find a location, assume invalid and skip - next FIRST unless defined $location; + next FIRST unless $location; my $version = get_sbo_version $location; if (versioncmp($version, $$pkg_list[$key]{version}) == 1) { push @updates, { diff --git a/sboinstall b/sboinstall @@ -96,7 +96,7 @@ if ($no_reqs or $non_int) { %locations = get_sbo_location($build_queue); for my $sbo (@$build_queue) { usage_error "Unable to locate $sbo in the SlackBuilds.org tree." unless - defined $locations{$sbo}; + $locations{$sbo}; if ($compat32) { usage_error "-p|--compat32 is not supported with Perl SBos." if $locations{$sbo} =~ qr|/perl/[^/]+$|; diff --git a/sboupgrade b/sboupgrade @@ -99,7 +99,7 @@ for my $sbo (@sbos) { $name =~ s/-compat32//; $locations{$sbo} = get_sbo_location($name); usage_error "Unable to locate $sbo in the SlackBuilds.org tree." unless - defined $locations{$sbo}; + $locations{$sbo}; if ($sbo =~ /-compat32$/) { usage_error "compat32 Perl SBos are not supported." if $locations{$sbo} =~ qr|/perl/[^/]+$|; diff --git a/t/test.t b/t/test.t @@ -102,7 +102,7 @@ print "completed pseudo-random testing of get_installed_packages 'ALL' \n"; # get_sbo_location tests is(get_sbo_location ('nginx'), "$sbo_home/network/nginx", 'get_sbo_location is good'); -is(get_sbo_location ('omgwtfbbq'), undef, +is(get_sbo_location ('omgwtfbbq'), 0, 'get_sbo_location returns false with not-an-sbo input'); my @finds = qw(nginx gmpc); my %locs = get_sbo_location(@finds);