Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Using p2 expression or QL to query all IUs which provide a capability in a specific namespace

This is where I got confused.

everything.select(<some selection _expression_>).latest()

Here it seems like everything.select(<some selection _expression_>) would return a collection of IUs. Then the latest() would just go through the collection of IUs regardless of the id and find the one that has the largest version and the result would be a single IU. Does latest() actually pick the latest version of each group of IUs with the same id? Thanks for your help.

Tom



Inactive hide details for Thomas Hallgren ---02/23/2010 12:09:23 PM---On 02/23/2010 07:04 PM, Thomas Watson wrote:Thomas Hallgren ---02/23/2010 12:09:23 PM---On 02/23/2010 07:04 PM, Thomas Watson wrote:


From:

Thomas Hallgren <thomas@xxxxxxx>

To:

P2 developer discussions <p2-dev@xxxxxxxxxxx>

Date:

02/23/2010 12:09 PM

Subject:

Re: [p2-dev] Using p2 _expression_ or QL to query all IUs which provide a capability in a specific namespace




On 02/23/2010 07:04 PM, Thomas Watson wrote:
>
> What if you wanted the latest version of the IU for a bundle?
>
> new ExpressionContextQuery(IInstallableUnit.class, "latest(x |
> x.providedCapabilities.exists(p | p.namespace == 'osgi.bundle'))");
>
Yes, that will work. It's actually a short notation of:

everything.select(iu | iu.providedCapabilities.exists(p | p.namespace ==
'osgi.bundle')).latest()

- thomas

_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev


GIF image

GIF image


Back to the top