Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-PAUSE-CleanUpHomeDir CPAN distribution.

Report information
The Basics
Id: 81158
Status: resolved
Priority: 0/
Queue: WWW-PAUSE-CleanUpHomeDir

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

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Incorrect sorting
Instead of just using default sort(), the files should be sorted properly by version number. Here's a patch to CleanUpHomeDir.pm. It adds a dependency to Sort::Versions. Seems to run OK on my PAUSE account. Regards, Steven
Subject: cleauphomedir-patch.patch
--- perl5/lib/perl5/WWW/PAUSE/CleanUpHomeDir.pm.orig 2012-11-14 14:08:38.000000000 +0700 +++ perl5/lib/perl5/WWW/PAUSE/CleanUpHomeDir.pm 2012-11-14 14:56:08.000000000 +0700 @@ -11,6 +11,7 @@ use HTML::TokeParser::Simple; use File::Basename; use Devel::TakeHashArgs; +use Sort::Versions; use base 'Class::Data::Accessor'; __PACKAGE__->mk_classaccessors qw( error @@ -97,7 +98,11 @@ and $list_ref->{$_}{status} !~ /$scheduled_re/ } keys %$list_ref; - my @files = sort keys %files; + my @files = sort { + my ($na, $va) = $a =~ /(.+)-(\d.+)/; + my ($nb, $vb) = $b =~ /(.+)-(\d.+)/; + $na cmp $nb || versioncmp($va, $vb); + } keys %files; my @old; my $re = qr/([^.]+)-/; @@ -138,7 +143,7 @@ return $self->_set_error('No files to delete') unless @files; - my $mech = $self->_mech; + my $mech = $self->_mech; $mech->form_number(1); # we already loaded the page from ->list_old $mech->tick('pause99_delete_files_FILE', $_ )
Thanks for the patch (sorry it took so longer). Corrections were made, contributions noted, and new version has been shipped to CPAN.