sbotools2

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

commit c95f0b44ba2f9ab743875e655a48bf7c634a6213
parent 49410cd7cbf44be774f421db0d314c015d730796
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date:   Fri, 11 Dec 2015 00:11:08 +0100

Changed check of $sbo_home to $repo_path

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

diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm @@ -220,16 +220,15 @@ sub chk_slackbuilds_txt { } # check for the validity of new $config{SBO_HOME} -sub check_home { - my $sbo_home = $config{SBO_HOME}; - if (-d $sbo_home) { - opendir(my $home_handle, $sbo_home); - FIRST: while (my $dir = readdir $home_handle) { +sub check_repo { + if (-d $repo_path) { + opendir(my $repo_handle, $repo_path); + FIRST: while (my $dir = readdir $repo_handle) { next FIRST if $dir =~ /^\.[\.]{0,1}$/; - usage_error("$sbo_home exists and is not empty. Exiting.\n"); + usage_error("$repo_path exists and is not empty. Exiting.\n"); } } else { - make_path($sbo_home) or usage_error("Unable to create $sbo_home.\n"); + make_path($repo_path) or usage_error("Unable to create $repo_path.\n"); } return 1; } @@ -334,7 +333,7 @@ sub generate_slackbuilds_txt { # wrappers for differing checks and output sub fetch_tree { - check_home(); + check_repo(); say 'Pulling SlackBuilds tree...'; pull_sbo_tree(), return 1; }