Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CPAN-Mini CPAN distribution.

Report information
The Basics
Id: 15028
Status: resolved
Priority: 0/
Queue: CPAN-Mini

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.37_02
Fixed in: (no value)



Subject: One last change to reunify CPAN::Mini with my fork
When scanning for cleaned files, don't shortcut in the clean_file. Don't even add it to the list by filtering it out during the file scanning phase. i.e. Where you currently do... sub clean_unmirrored { my $self = shift; find sub { my $file = canonpath($File::Find::name); $self->clean_file($file); }, $self->{local}; } sub clean_file { my ($self, $file) = @_; return unless (-f $file and not $self->{mirrored}{$file}); return if $self->file_allowed($file); unless (unlink $file) { warn "$file ... cannot be removed: $!" if $self->{errors}; return; } $self->trace("$file ... removed\n"); } ... it might be better to do something like... sub clean_unmirrored { my $self = shift; find sub { my $file = canonpath($File::Find::name); return unless (-f $file and not $self->{mirrored}{$file}); return if $self->file_allowed($file); $self->trace($file); $self->clean_file($file); $self->trace(" ... removed\n"); }, $self->{local}; } sub clean_file { my ($self, $file) = @_; unlink $file or warn "Cannot remove $file $!"; } This keeps the subclasses much cleaner. ->clean_file is only called if it ACTUALY needs to be cleaned, not speculatively.
I seem to have applied this in a previous release and not closed the bug! -- rjbs