aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2018-06-04 00:39:28 -0400
committerB. Watson <yalhcru@gmail.com>2018-06-04 00:39:28 -0400
commitab6c9900ccdaf545bdfe773ab12fdd63e0b0ffa5 (patch)
tree1e4651b35c23eb0ba8f4b73e26d6ba21681d87a5
parent592e52ce9f4a7edc945bb17073af43e8e261509f (diff)
downloadsbostuff-ab6c9900ccdaf545bdfe773ab12fdd63e0b0ffa5.tar.gz
sbosrcarch purge_mode fix, wip
-rwxr-xr-xsbosrcarch7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbosrcarch b/sbosrcarch
index 2c4c8ae..44e60ef 100755
--- a/sbosrcarch
+++ b/sbosrcarch
@@ -1267,7 +1267,7 @@ sub purge_pass_1_wanted {
for(keys %$dls) {
my $path = "by-name/$cat/$name/" . url_to_filename($_);
$keep_filenames{$path}++;
- # TODO: populate %keep_md5sums
+ $keep_md5sums{$dls{$_}}++;
}
}
@@ -1295,9 +1295,12 @@ sub purge_pass_2_wanted {
# helper for purge_mode, removes all files in by-md5
# dirs that aren't listed in %keep_md5sums
sub purge_pass_3_wanted {
- s,^\./,,; # remove leading ./
return unless -d $_; # not necessarily necessary...
+
+ s,^\./,,; # remove leading ./
my (undef, undef, undef, $md5sum) = split /\//, $_;
+ return unless defined $md5dum;
+
if($keep_md5sums{$md5sum}) {
print "keep md5sum: $md5sum\n";
} else {