Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 199311 - include information to aid in solving package database problems (man page/program output)
Summary: include information to aid in solving package database problems (man page/pro...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 200044
  Show dependency tree
 
Reported: 2007-11-15 23:11 UTC by Ariel Poliak
Modified: 2007-11-23 03:51 UTC (History)
0 users

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


Attachments
show the path of the CONTENTS file when any kind of parse error occurs (contents_error.patch,1.76 KB, patch)
2007-11-16 00:13 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ariel Poliak 2007-11-15 23:11:42 UTC
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
Comment 1 Zac Medico gentoo-dev 2007-11-15 23:34:33 UTC
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.
Comment 2 Zac Medico gentoo-dev 2007-11-16 00:13:54 UTC
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
Comment 3 Zac Medico gentoo-dev 2007-11-23 03:51:44 UTC
This has been released in 2.1.4_rc1.