Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 123725 - gentoolkit-0.2.2_pre2: bugs in equery deps parsing
Summary: gentoolkit-0.2.2_pre2: bugs in equery deps parsing
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-02-22 10:28 UTC by TGL
Modified: 2006-06-19 21:16 UTC (History)
1 user (show)

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


Attachments
gentoolkit-0.2.2_pre2--deps-parsing-fix.patch (gentoolkit-0.2.2_pre2--deps-parsing-fix.patch,800 bytes, patch)
2006-02-22 10:29 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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