Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 123725

Summary: gentoolkit-0.2.2_pre2: bugs in equery deps parsing
Product: Portage Development Reporter: TGL <tom.gl>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: gentoolkit-0.2.2_pre2--deps-parsing-fix.patch

Description TGL 2006-02-22 10:28:32 UTC
Here are two bugs i see in the gentoolkit.package.Package._parse_deps() method:
 * there is no recursion for conjonction "( foo bar )", which leads to wrong parenthesis grouping and makes the function stop its parsing before reaching the end of the deps string.
 * any token starting with a '!' is assumed to be a USE flag, whereas it can be an anti-dep (for packages incompatibilities).


Test cases:

% equery depends libcaca
[ Searching for packages depending on libcaca... ]
media-libs/libsdl-1.2.9-r1
media-video/xine-ui-0.99.4-r3
("media-video/mplayer" is missing in this list, whereas it is installed with the "libcaca" flag, because the "libcaca" dep comes after a bunch of parenthesis related to GTK deps)

% equery depgraph mplayer
...
           `-- x11-base/xorg-x11-7.0-r1
            `-- x11-apps/mesa-progs-6.4.2 [ !<=x11-base/xorg-x11-6.9 ]
...
(blocked package is reported as a USE flag)


I will attach a patch which fixes this issues:
 * for the first one, it adds recursion when reaching an opening parenthesis which is not preceded by a "||" or a "flag?".
 * for the second one, ii removes the wrong assumption about "!" marking USE flags (the check on "?" is enough), and adds a case to ignore "!cat/pkg" tokens. 

Note that ignoring "!cat/pkg" atoms may not be what you want: it depends what behavior you think is the best for "equery depgraph" (list blocked package in the results, or not), so you may want to change that part.
Comment 1 TGL 2006-02-22 10:29:06 UTC
Created attachment 80440 [details, diff]
gentoolkit-0.2.2_pre2--deps-parsing-fix.patch
Comment 2 Paul Varner (RETIRED) gentoo-dev 2006-03-01 11:39:31 UTC
Patch is in subversion, thanks!
Comment 3 Paul Varner (RETIRED) gentoo-dev 2006-06-19 21:16:32 UTC
released in gentoolkit-0.2.2