Ticket #41 - innreport creates incorrect file names at the start of the year

Julien ÉLIE julien at trigofacile.com
Sun Jan 18 09:58:06 UTC 2009


Hi Alexander,

> Ticket #41 - innreport creates incorrect file names at the start of the year

Thanks a lot for your patch!
I see that it fixes both the wrap-around in date values and the
assignment of $last_date when log entries are sorted descending
(though "Jan 03;Jan 02;Jan01" will see "Jan 01--Jan01").

Anyway, we will now have pretty innreport pages for the New Year!



> + # Innreport assumes that it is running in the same year the log
> + # file was written. This has just been proven false. All dates
> + # processed up to now are from last year, not current year. Leap
> + # year calculation for them was wrong. There is no easy way to
> + # correct this.
> + #
> + # However, we can simply assume that dates before 1st of May
> + # belong to current year. With this definition it is not possible
> + # to cross from both 31st of December to 1st of January and from
> + # 28th of February to 1st of March in the same log file.
> + #
> + # Note: $month_to_dayofyear[12] - $month_to_dayofyear[4] = 245

I do not understand well the comment.  A file which contains information
from December, 25th to April, 9th works fine for me.
But not November, 25th to April, 9th.  What is May, 1st for?


>      elsif ($cvtdate > $last_date_cvt) {
>        $last_date_cvt = $cvtdate;
> -      $last_date = "$day $hour";
> +      $last_date = $date_str;
>      }
>    }
>
> +    ########
> +    ## Program name
> +    # word[7164] -> word
> +    my ($pid) = $prog =~ s/\[(\d+)\]$//o;
> +    # word: -> word
> +    $prog =~ s/:$//o;
> +    # wordX -> word   (where X is a digit)
> +    $prog =~ s/\d+$//o;

At line 505, there is "}" which should be removed.  (I trusted your indentation
to do that.)
Or should have it been removed at line 522?

-- 
Julien ÉLIE

« C'est une forêt vierge où la main de l'homme n'a jamais mis le pied. » 




More information about the inn-workers mailing list