Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 450146 - app-portage/genlop-0.30.8-r2 does not handle empty and missing files gracefully
Summary: app-portage/genlop-0.30.8-r2 does not handle empty and missing files gracefully
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2013-01-04 07:48 UTC by Massimo Burcheri
Modified: 2023-07-18 22:09 UTC (History)
0 users

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 Massimo Burcheri 2013-01-04 07:48:55 UTC
I'm rotating /var/log/emerge.log by logrotate with 2 bzip2 archives. So I have that alias in my profile:

alias genlop='genlop -f /var/log/emerge.log -f /var/log/emerge.log.1.bz2 -f 

That usually works fine but leads to errors if some of the files are missing or empty.

So I start with an empty set by
# touch /var/log/emerge.log.{1,2}.bz2

But these empty files lead to perl warnings:

using logfile /var/log/emerge.log
using logfile /var/log/emerge.log.1.bz2
using logfile /var/log/emerge.log.2.bz2
Use of uninitialized value $fline in split at /usr/bin/genlop line 159.
Use of uninitialized value $fline in split at /usr/bin/genlop line 159.
Use of uninitialized value $ordered{"/var/log/emerge.log.2.bz2"} in numeric comparison (<=>) at /usr/bin/genlop line 161.
Use of uninitialized value $ordered{"/var/log/emerge.log"} in numeric comparison (<=>) at /usr/bin/genlop line 161.
Use of uninitialized value $ordered{"/var/log/emerge.log.2.bz2"} in numeric comparison (<=>) at /usr/bin/genlop line 161.
Use of uninitialized value $ordered{"/var/log/emerge.log"} in numeric comparison (<=>) at /usr/bin/genlop line 161.


Please make genlop
1. more tolerant for missing files and
2. more robust for empty files
Comment 1 Paul Varner (RETIRED) gentoo-dev 2013-01-22 20:43:20 UTC
This has been fixed and pushed to the git repository.  You can test using genlop-9999 which is the same as genlop-0.30.9-r1 plus a bash completion fix and this change.

This change now does the following
1. Warns if a log file is unreadable
2. Does not print "Use of uninitialized value" if the log file is empty
3. If no readable log files are found, it warns and defaults to /var/log/emerge.log
Comment 2 Massimo Burcheri 2013-01-24 08:46:15 UTC
Thanks, perl warnings are removed.
However that current version seems to add another bug 453774.