Bug#861952: libcgi-validop-perl: FTBFS on May 1st (?)

Niels Thykier niels at thykier.net
Sat May 6 11:30:00 UTC 2017


Control: severity -1 grave
Control: tags -1 stretch-ignore

On Sat, 06 May 2017 11:10:00 +0000 Santiago Vila <sanvila at debian.org> wrote:
> Package: src:libcgi-validop-perl
> Version: 0.56-2
> Severity: important
> 
> Hello Gregor et al.
> 
> I tried to build this package in stretch with "dpkg-buildpackage -A"
> but it failed:
> 
> [...]
> 
> The build was made on 2017-05-01 and the error says
> 
> expected: '2017-04-31'
> 
> which does not exist, as April has only 30 days.
> 
> This suggests a date-related bug.
> 
> I have not tried to reproduce it by building it again on May 1st.
> Maybe this could be done by using libfaketime, but I think a better
> strategy would be to look at the code and the error message and try to
> guess how it may happen.
> 
> Thanks.
> 
> 

I looked at the code[1] and it has:

>             # Normlize
>             # Unless we are checking the present or yesterday, assume the biggest day of the month is 28
>             my $maxday = (
>                 $time eq 'present' or  
>                 ( $time eq 'past' and $vector eq 'day' )
>             ) ? 31 : 28;

Take the branch that leads to "31" and then:

> [...]
>             if ( $vectors->{ day } < 1 ) {
>                 $vectors->{ day } = $maxday;
>                 $vectors->{ month }--;
>             }

Which looks like it would get this wrong for all months with < 31 days
in them on the yesterday.  I have tagged it stretch-ignore, but I am
happy to consider a fix for stretch.

Thanks,
~Niels

[1]
https://anonscm.debian.org/cgit/pkg-perl/packages/libcgi-validop-perl.git/tree/t/16check_date.t#n222



More information about the pkg-perl-maintainers mailing list