During an emerge operation (--update --newuse --deep system), I got a message from emerge stating that it thought multiple packages were trying to claim a file as their own. In order to see if there was a need to submit a bug for that file, I ran "portageq owners / /usr/lib/python2.5/site-packages/obexftp/__init__.pyc" and got the error message "!!! Unrecognized CONTENTS entry on line 1: ''"(and no clue if processing went on). Thinking it might be a bug in portageq, I ran the equivalent command in equery ("equery belongs /usr/lib/python2.5/site-packages/obexftp/__init__.pyc") and got the exact same message. This pointed me towards the portage backend as the source of the problem. Following the advice given at http://www.vivalv.de/Linux/Tipps/Gentoo (in German, Google does a decent translation of it), I ran "strace portageq owners / /usr/lib/python2.5/site-packages/obexftp/__init__.pyc > log.txt 2>&1" and found out the problem-causing package was sys-kernel/livecd-kernel-1. I removed the /var/db/pkg/livecd-kernel-1 directory and problem was resolved. It would have been much easier to diagnose the problem if the portage man page mentioned how to do this, so I would not have to hunt for it, or if the portage backend, along with the error message, printed out which file it was processing at the time of the error to instantly know where the error is located. Reproducible: Always Steps to Reproduce: NOTE: assumes error is not already happening 1. choose a package at random 2. back up its folder under /var/db/pkg/(section)/(package) (ie /var/db/pkg/sys-kernel/gentoo-sources-2.6.23-r1) 3. modify the package's CONTENTS file in the folder above, leaving it with a single blank line 4. "portageq owners / /usr/src/linux/" (file does not matter, any file will do) 5. get "!!! Unrecognized CONTENTS entry on line 1: ''" error message 6. restore backup 7. run command from step 5 again 8. note lack of error message Actual Results: after breaking: "!!! Unrecognized CONTENTS entry on line 1: ''" error comes up after fixing: usual operation Expected Results: error message should include package being processed at the time the error occurred. AND/OR portage man page should suggest how to find the package at fault
I think I'll change it show the errors for a given CONTENTS file in a batch, with a banner at the top showing the path of that CONTENTS file.
Created attachment 136068 [details, diff] show the path of the CONTENTS file when any kind of parse error occurs If this patch is saved as /tmp/contents_error.patch, then it can be applied as follows: patch /usr/lib/portage/pym/portage.py < /tmp/contents_error.patch
This has been released in 2.1.4_rc1.