Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 526752 - sys-apps/logwatch: emerge.log parsing broken since Perl 5.18.x
Summary: sys-apps/logwatch: emerge.log parsing broken since Perl 5.18.x
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-25 12:35 UTC by Christian Ruppert (idl0r)
Modified: 2023-01-13 03:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Ruppert (idl0r) gentoo-dev 2014-10-25 12:35:01 UTC
Hi,

the emerge.log parser is broken since Perl 5.18.x.

/var/log/emerge.log.offset contains two timestamps and the last one has no newline.
Later the offset file is concated with /var/log/emerge.log which then ends up in a line with two timestamps not being separated, like:
74685231323806403: Started emerge on: Dec 13, 2011 21:00:03
instead of:
7468523
1323806403: Started emerge on: Dec 13, 2011 21:00:03

This caused an error with Perl 5.18.x because strftime() is more strict now and just not simply ignores such broken lines.
That happens in:
/usr/share/logwatch/scripts/logfiles/emerge/applydate


The actual problem is IMHO in logwatch itself, not the applydate nor the Portage part. Other modules/script just don't throw an error because they handle/parse it somewhat different but they all should get similar broken lines since logwatch concats those files together.
IMHO the best solution is: to either add a newline to the offset files and/or write a newline char after printing/piping the offset file.

The actual error for emerge/portage is:
Usage: POSIX::strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1) at /usr/share/logwatch/scripts/logfiles/emerge/applydate line 69, <STDIN> line 2.
system 'cat '/var/cache/logwatch/logwatch.sg2KnV_A/emerge-archive' '/var/log/emerge.log'  | /usr/bin/perl5.18.2 /usr/share/logwatch/scripts/logfiles/emerge/applydate>/var/cache/logwatch/logwatch.sg2KnV_A/emerge'
failed: 65280 at /usr/sbin/logwatch.pl line 862.

Tested with logwatch up to 7.4.0_p170-r1. There is a 7.4.1 release which I haven't tried yet but I doubt it has been fixed there already. But I'll take a look later.