Skip Menu |

This queue is for tickets about the Algorithm-Cron CPAN distribution.

Report information
The Basics
Id: 80262
Status: resolved
Priority: 0/
Queue: Algorithm-Cron

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

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: 0.04



Subject: Month globs wrongly decremented
It fails the test (t/01expand.t): is_deeply( expand( "*/3", "mon" ), [ 0, 3, 6, 9 ], 'expand mon=*/3' ); because it sets the start & end points to correct values and then enters the conditional which further decrements the month values. The attached patch brings the setting of end points to within the conditional. (btw, thanks for providing this code, it solves a lot of problems) best regards, Nic Sandfield
Subject: fix-month-glob.patch
--- lib/Algorithm/Cron.pm 2012-10-16 12:30:15.000000000 +0100 +++ lib/Algorithm/Cron.pm.new 2012-10-18 11:53:35.000000000 +0100 @@ -163,9 +163,11 @@ $val =~ s{/(\d+)$}{} and $step = $1; $val =~ m{^(.+)-(.+)$} and ( $val, $end ) = ( $1, $2 ); - $val eq "*" and ( $val, $end ) = ( $MIN{$kind}, $MAX{$kind} ); - if( $kind eq "mon" ) { + if( $val eq "*" ) { + ( $val, $end ) = ( $MIN{$kind}, $MAX{$kind} ); + } + elsif( $kind eq "mon" ) { # Users specify 1-12 but we want 0-11 defined and m/^\d+$/ and $_-- for $val, $end; # Convert symbolics
On Thu Oct 18 07:05:18 2012, NICZERO wrote: Show quoted text
> It fails the test (t/01expand.t): > > is_deeply( expand( "*/3", "mon" ), [ 0, 3, 6, 9 ], 'expand mon=*/3' ); > > because it sets the start & end points to correct values and then enters > the conditional which further decrements the month values. The attached > patch brings the setting of end points to within the conditional.
Ahyes, indeed. Patch applied, will be in next version. -- Paul Evans
This was released as 0.04. (quite some time ago but I forgot to close this ticket) -- Paul Evans