Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 322883 - portage package set operator expressions
Summary: portage package set operator expressions
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 144480 634092 651130
  Show dependency tree
 
Reported: 2010-06-05 17:15 UTC by Zac Medico
Modified: 2022-10-20 02:43 UTC (History)
1 user (show)

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 Zac Medico gentoo-dev 2010-06-05 17:15:38 UTC
The idea is to support package set operations such as | (union), & (intersection), and - (difference), using the same operator characters that python uses for the corresponding set operations. There will be a class called PackageSetExpression that will match packages against expressions such as "( @a & @b ) - ( @c | @d )". It will be used within the dependency resolver in much the same way that the PackageSet class is currently used. This is meant to solve problems with previous set operation support which was removed in these two commits:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84de8f714de5d4599c5ea8dd207ed237b6a3c883
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a650ded25b0b003a46b12824d1f7b8987cdae915

The issue with the previous support was that intersection between sets only worked if those sets contained identical atoms, even if those sets contained different atoms that happened to match the same packages. The new support will solve this issue by using intersection of matched packages instead of intersection of atoms. The PackageSetExpression will probably convert expressions from infix to postfix, in order to facilitate the use of a stack-based evaluation algorithm.
Comment 1 Zac Medico gentoo-dev 2010-06-05 23:47:29 UTC
Unlike a PackageSet, a PackageSetExpression does not have a well-defined set of atoms that can be pulled into the dependency graph. Instead, it will have a set of candidate atoms that is generated from the sets contained in the expression. The dependency resolver will select a package instance to match a candidate atom, and then it will check whether or not the selected package actually matches the expression.