diff options
author | Jacob Pipkin <d4wnr4z0r@yahoo.com> | 2012-05-09 13:08:42 -0500 |
---|---|---|
committer | Jacob Pipkin <d4wnr4z0r@yahoo.com> | 2012-05-09 13:08:42 -0500 |
commit | 4c0be3f2cf5c9ef61bc66baafb1630d04f1c44e7 (patch) | |
tree | 8c4ae73c45d7c2d297bb9e84ce21f813f035a7e0 /SBO-Lib/lib | |
parent | 373ec26a8141e284388d761b218e4b64f4ce1305 (diff) | |
download | sbotools2-4c0be3f2cf5c9ef61bc66baafb1630d04f1c44e7.tar.xz |
fix bug where distclean'ing doesn't work, plus other cleanups
Diffstat (limited to 'SBO-Lib/lib')
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 31358f0..6b45b98 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -338,18 +338,19 @@ sub compute_md5sum { sub get_filename_from_link { script_error ('get_filename_from_link requires an argument') unless exists $_[0]; - my @split = split ('/',reverse ($_[0]) ,2); + my @split = split ('/',reverse (shift) ,2); chomp (my $filename = $distfiles .'/'. reverse ($split[0]) ); return $filename; } sub check_distfile { - script_error ('check_distfile requires an argument.') unless exists $_[0]; - my $filename = get_filename_from_link ($_[0]); + script_error ('check_distfile requires two arguments.') unless exists $_[1]; + my ($link,$info_md5sum) = @_; + my $filename = get_filename_from_link ($link); return unless -d $distfiles; return unless -f $filename; my $md5sum = compute_md5sum ($filename); - return unless $_[1] eq $md5sum; + return unless $info_md5sum eq $md5sum; return 1; } @@ -469,14 +470,14 @@ sub make_clean { } sub make_distclean { - script_error ('make_distclean requires two arguments.') - unless exists $_[1]; + script_error ('make_distclean requires three arguments.') + unless exists $_[2]; my ($sbo,$version,$location) = @_; make_clean ($sbo,$version); print "Distcleaning for $sbo-$version...\n"; my @downloads = get_sbo_downloads ($sbo,$location); - for my $dl (@downloads) { - my $filename = get_filename_from_link ($dl); + for my $c (keys @downloads) { + my $filename = get_filename_from_link ($downloads[$c]{link}); unlink ($filename) if -f $filename; } return 1; |