Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 567684 - app-portage/gentoolkit-0.3.0.9-r2: "equery check -N" conflicts with python buffering
Summary: app-portage/gentoolkit-0.3.0.9-r2: "equery check -N" conflicts with python bu...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-06 22:27 UTC by Fabio Rossi
Modified: 2015-12-06 22:27 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 Fabio Rossi 2015-12-06 22:27:08 UTC
"equery check" tool is using a printer function which is using both stdout and stderr. I'm trying to redirect stderr and stdout to the same file (using bash redirection) to save a log. Here is an example:

# equery -NC check portage  
* Checking sys-apps/portage-2.2.20.1 ...
!!! /etc/dispatch-conf.conf has incorrect MD5sum
!!! /etc/etc-update.conf has incorrect MD5sum
   3757 out of 3759 files passed

Everything looks fine up to now. The next step is to redirect to a file:

# equery -NC check portage &> log.txt
# cat log.txt
!!! /etc/dispatch-conf.conf has incorrect MD5sum
!!! /etc/etc-update.conf has incorrect MD5sum
* Checking sys-apps/portage-2.2.20.1 ...
   3757 out of 3759 files passed

As you can see the order of the lines is now messed. To fix the issue I need to disable python buffering:

# PYTHONUNBUFFERED=1 equery -NC check portage &> log.txt
# cat log.txt
* Checking sys-apps/portage-2.2.20.1 ...
!!! /etc/dispatch-conf.conf has incorrect MD5sum
!!! /etc/etc-update.conf has incorrect MD5sum
   3757 out of 3759 files passed

This means that the code should disable the buffering or flushing after every write to preserve the correct order of the output lines.