Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 310319

Summary: [tools] Support p2.ql on ant <iu> elements
Product: [Eclipse Project] Equinox Reporter: Andrew Niefer <aniefer>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: irbull, nfalco79, pascal, thomas
Version: 3.6Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Andrew Niefer CLA 2010-04-23 14:44:05 EDT
Various p2 ant tasks, in particular, <p2.mirror/> and <p2.remove.iu/> use nested <iu/> elements to indicate which IUs we should be working with.

The iu element currently supports a "query" attribute, where all IUs matching the query are considered.

Originally, the only "query" supported was on properties:
<iu query="property[@name='propertyName' and @value='propertyValue']" />

See bug 270894 where this was introduced.

This currently translated into a 
QueryUtil#createPropertyQuery(name, value)

Unfortunately, this is very limiting, you can't do for example: match all IUs that don't have 'org.eclipse.equinox.p2.type.group == 'true'

If possible it would be good to allow p2.ql queries here.  We need to still support the old syntax for properties, but we should be able to do create IU queries given some expression on the query attribute.

Bug 307573 is an example where more expressiveness would have been useful.
Comment 1 Andrew Niefer CLA 2010-04-23 14:52:33 EDT
p2.repository.tools/IUDescription#createQuery() is where these queries are created.
Comment 2 Andrew Niefer CLA 2010-10-22 13:24:52 EDT
*** Bug 328495 has been marked as a duplicate of this bug. ***
Comment 3 Pascal Rapicault CLA 2010-12-23 22:48:17 EST
If anyone provides a tested patch, I'm happy to release it. The code is contained in org.eclipse.equinox.p2.repository.tools and very likely the class AbstractRepositoryTask that is a super class of MirrorTask.
Comment 4 Nikolas Falco CLA 2011-01-25 03:24:57 EST
Can you post complete URL where download sources or an exported plugin with source to test it?
Comment 5 Pascal Rapicault CLA 2011-02-02 21:45:46 EST
Sorry Nikolas, I missed your answer. The best way is to take a recent build of eclipse 3.7 (http://download.eclipse.org/eclipse/downloads/) and use the import plugin wizard and select the "Project from repository" in the "import as" section.

The other possibility is to simply directly import from CVS (again use 3.7 becuase of dependencies) 
  host: dev.eclipse.org
  path: /cvsroot/rt
  module: org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository.tools
Comment 6 Lars Vogel CLA 2019-11-14 03:45:00 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.