[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Uses constraints support in the p2 Projector

I am trying to describe the most obvious brute force way to verify uses constraints of one wire are satisfied:

i) Build recursively a set of all "reachable" packages:
 0. Start with the capability of the wire
 1. For every package in the capability "uses" list
 2. Search the wire host bundle for requirements of that package
 3. For every requirement find all matching capabilities
 4. Recursively repeat for each capability

ii) Then find the subset of reachable packages that are directly imported by the initial bundle
Â1. Match each requirement of the bundle to each candidate capability
Â2. Get only the matches

iii) Then split the resulting set into sub-sets of duplicate package versions
 E.g. {{org.foo 1.0, org.foo 2.0, ...}, ..., {org.bar 1.0, org.bar 2.0, ...}, ...}

iv) Then require that the bundle wires to only one version per sub-set:
 E.g. {org.foo 1.0, org.bar 2.0}

I am not considering Require-Bundle yet.

Is this correct?