From 8d1340ddb872edb96d39234f7c0b7499a4cba95e Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Thu, 30 Aug 2012 10:38:02 -0500 Subject: bugfixes --- SBO-Lib/lib/SBO/Lib.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'SBO-Lib/lib/SBO/Lib.pm') diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index bd00c9a..3f75d80 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -111,7 +111,7 @@ sub show_version () { } # %supported maps what's in /etc/slackware-version to what's at SBo -sub get_slack_version { +sub get_slack_version () { my %supported = ( '13.37.0' => '13.37', '14.0' => '13.37', @@ -183,7 +183,7 @@ sub slackbuilds_or_fetch () { sub get_installed_sbos () { my @installed; # $1 == name, $2 == version - my $regex =~ qr#/([^/]+)-([^-]+)-[^-]+-[^-]+$#; + my $regex = qr#/([^/]+)-([^-]+)-[^-]+-[^-]+$#; for my $path () { my ($name, $version) = ($path =~ $regex)[0,1]; push @installed, {name => $name, version => $version}; @@ -245,7 +245,7 @@ sub get_from_info (%) { # find the version in the tree for a given sbo (provided a location) sub get_sbo_version ($) { - exists $_[1] or script_error 'get_sbo_version requires two arguments.'; + exists $_[0] or script_error 'get_sbo_version requires an arguments'; my $version = get_from_info (LOCATION => shift, GET => 'VERSION'); return $$version[0] ? $$version[0] : 0; } @@ -391,12 +391,12 @@ sub get_symlink_from_filename ($$) { -f $_[0] or script_error 'get_symlink_from_filename first argument is not a file'; my ($filename, $location) = @_; - return "$location/". ($filename =~ qr#/([^/]+)$#[0]; + return "$location/". ($filename =~ qr#/([^/]+)$#)[0]; } # determine whether or not a given sbo is 32-bit only sub check_x32 ($) { - exists $_[1] or script_error 'check_x32 requires two arguments.'; + exists $_[0] or script_error 'check_x32 requires an argument.'; my $dl = get_from_info (LOCATION => shift, GET => 'DOWNLOAD_x86_64'); return $$dl[0] =~ /UN(SUPPOR|TES)TED/ ? 1 : 0; } @@ -418,7 +418,7 @@ sub rewrite_slackbuild ($$%) { my $makepkg_regex = qr/makepkg/; my $libdir_regex = qr/^\s*LIBDIRSUFFIX="64"\s*$/; my $make_regex = qr/^\s*make(| \Q||\E exit 1)$/; - my $arch_out_regex = qr/\$VERSION-\$ARCH-\$BUILD/; + my $arch_regex = qr/\$VERSION-\$ARCH-\$BUILD/; # tie the slackbuilds, because this is the easiest way to handle this. tie my @sb_file, 'Tie::File', $slackbuild; for my $line (@sb_file) { @@ -669,7 +669,7 @@ sub make_distclean (%) { make_clean $sbo, $args{SRC}, $args{VERSION}; say "Distcleaning for $sbo-$version..."; # remove any distfiles for this particular SBo - my %downloads = get_sbo_downloads (LOCATION = $args{LOCATION}); + my %downloads = get_sbo_downloads (LOCATION => $args{LOCATION}); for my $key (keys %downloads) { my $filename = get_filename_from_link $key; unlink $filename if -f $filename; -- cgit v1.2.3