Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 174870 - sys-apps/logwatch: bad time check in emerge module
Summary: sys-apps/logwatch: bad time check in emerge module
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-17 06:10 UTC by Alexandre Ghisoli
Modified: 2011-06-19 21:51 UTC (History)
7 users (show)

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


Attachments
logwatch-emerge-year.patch (logwatch-emerge-year.patch,853 bytes, patch)
2008-01-12 17:11 UTC, Alexandre Ghisoli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Ghisoli 2007-04-17 06:10:20 UTC
since 7.3.4, there is a new timecheck against localtime() :
$emergeTime = strftime('%b %e %H:%M:%S', localtime($1));

But, it doensnt check year !! So logwatch is printing emerged package but from a past year.



Reproducible: Always
Comment 1 Kevin Parent 2007-05-24 15:47:21 UTC
I confirm this bug.
Comment 2 Alexandre Ghisoli 2008-01-12 17:11:30 UTC
Created attachment 140815 [details, diff]
logwatch-emerge-year.patch

This patch will allow logwatch emerge module to take care of the year.
Comment 3 Kevin Parent 2008-01-15 16:43:38 UTC
Looks like that does the trick.

Thanks Alexandre
Comment 4 Rick Hewett 2009-03-17 14:24:48 UTC
Problem re-surfaced (or perhaps it was there and I didn't notice) in sys-apps/logwatch-7.3.6

Patch in this ticket fixes it.
Comment 5 Kevin Parent 2009-03-18 18:33:42 UTC
I just checked 2 different machines.  Both already have the correct entries.  If you a gentoo install that had an older version of logwatch, you man need to manually clean out /etc/logwatch/*.  The newer versions use that location as an overide to the defaults which are in /usr/share/logwatch.  So if you have an old /etc/logwatch/scripts/logfiles/emerge/applydate, that may be causing the issue.
Comment 6 Quincy 2009-03-20 07:52:55 UTC
As logwatch 7.3.4 never was stable, i recently updated to 7.3.6 and ran into the same issue. As there is no default installation of any config into /etc/logwatch mailing stopped working (as this was no more default) and this problem was recognised, too.

I hope the patch will make it into the next logwatch version.
Comment 7 Rick Hewett 2009-03-27 11:32:21 UTC
(In reply to comment #5)
> I just checked 2 different machines.  Both already have the correct entries.

None of mine do. They all have 7.3.6 emerged, and they have clean /etc/logwatch/* directories (that is, only files I've actually needed to modify are included, and the modified versions are based on the 7.3.6 originals, not on earlier versions).

I have un-merged and re-emerged logwatch-7.3.6 and the problem version is still present. I copied out the contents of /usr/share/logwatch before unmerging:

# diff -s /usr/share/logwatch/scripts/logfiles/emerge/applydate /tmp/logwatch/scripts/logfiles/emerge/applydate
Files /usr/share/logwatch/scripts/logfiles/emerge/applydate and /tmp/logwatch/scripts/logfiles/emerge/applydate are identical

Comparing the installed version with my patched version, however:

# diff -s /usr/share/logwatch/scripts/logfiles/emerge/applydate /etc/logwatch/scripts/logfiles/emerge/applydate 
37c37
< my $SearchDate = TimeFilter('%b %e %H:%M:%S');
---
> my $SearchDate = TimeFilter('%Y %b %e %H:%M:%S');
51c51
<       $emergeTime = strftime('%b %e %H:%M:%S', localtime($1));
---
>       $emergeTime = strftime('%Y %b %e %H:%M:%S', localtime($1));

Just in case it's the source file that's the problem:

md5sum /usr/portage/distfiles/logwatch-7.3.6.tar.gz
937d982006b2a76a83edfcfd2e5a9d7d  /usr/portage/distfiles/logwatch-7.3.6.tar.gz
Comment 8 Phil Davidov 2009-08-26 16:04:12 UTC
This affects my logwatch install as well.  Patch fixes the issue for logwatch-7.3.6.

Can we commit this patch to the repository?
Comment 9 Nick Soveiko 2009-10-05 16:18:14 UTC
(In reply to comment #8)

> Can we commit this patch to the repository?

second this.
Comment 10 Michael George 2009-11-26 10:14:01 UTC
(In reply to comment #9)
> (In reply to comment #8)
> 
> > Can we commit this patch to the repository?
> 
> second this.
> 

third...
Comment 11 Benedikt Böhm (RETIRED) gentoo-dev 2009-12-04 11:25:34 UTC
should be fixed in sys-apps/logwatch-7.3.7_pre20091204