|Re: [p2-dev] Querying remote p2 repositories|
On Jul 27, 2012, at 16:27, Kopecz, Klaus wrote:
IIRC, one p2-agent = one p2 area - i.e. the p2 api operates in a context. Don't know what is needed to initiate such an area though - have not written such code myself.
It uses a separate p2 agent afaik (or it would screw up its own configuration). You can probably look at the code in the b3 aggregator.
You can use a simpler read api in b3. I have written such code - e.g. "load this repository into a model", then get information from the EMF model.
It is quite easy actually.
Seems like the B3 aggregator "load repository" and then picking up the information you need would work just fine. You could even go fancy, and write a snapshot of the model, and compare with a freshly loaded repository (EMF compare could probably be used for that - or write something since you are probably not interested in comparing everything). You do however need to be familiar with the structure of a p2 repo/meta-data, the model itself does not really help you with that (i.e. the semantics of what is described). It is however *way* easier to write code against than the alternatives. Note that you do not need the entire b3 aggregator, just a couple of EMF bundles as you are only interested in reading (possibly writing) p2 repositories.
Don't know what you have to jump through such hoops with Tycho. We are using Buckminster to build products, never have to do something similar. Just rematerialize and build - always built with the latest bundles satisfying the constraints from the given repositories. We do use feature based product builds, as the Eclipse tooling for bundle based products is quite bad. (cloudsmith / geppetto @ github is a good example on multi platform build with Buckminster and feature based product builds btw). Saying this if you can do something similar with Tycho.
Hope that helps you.