[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] [p2] How to use director/mirror app against an RCP as p2 repo

Have you tried something like this?

$ ~/ profiles-ide/eclipse/eclipse.exe -application org.eclipse.equinox.p2.director -metadataRepository file:/C:/Users/creckord/profiles-ide/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/D__data_profiles_installations_profiles-ide_eclipse.profile/ -artifactRepository file:/C:/Users/creckord/profiles-ide/eclipse/ -destination C:/Users/creckord/git/profiles/tmp -installIU org.eclipse.core.runtime

It works for me. The Eclipse installation folder (or your bundle pool) has an artifacts.xml and can act like a regular artifact repository. You might run into some strangeness with features and product IUs though, since they aren't preserved 1:1 in their original form (features are usually extracted, but P2 will rebundle them on the fly for you; I don't quite remember what the situation was with products, but I've run into some repackaging issues way back in the Buckminster days)

> -----Original Message-----
> From: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-
> bounces@xxxxxxxxxxx] On Behalf Of Mickael Istria
> Sent: Monday, June 26, 2017 8:43 PM
> To: Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
> Subject: Re: [equinox-dev] [p2] How to use director/mirror app against an
> RCP as p2 repo
> 
> Thanks Carsten, that's a good hint.
> 
> So I tried to use the profile directory, and it's encouraging: I can list
> its content and install them in another IDE. So there is definitely
> everything necessary in it to use p2 director or p2 mirror.
> 
> However, I've tried using CLI:
> ```
> mistria@mistria-rh:~/sandbox/mirror$ ~/eclipse/eclipse -application
> org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/ -destination $(pwd)
> ```
> 
> Fails with
> ```
> !MESSAGE Application error
> !STACK 1
> org.eclipse.equinox.p2.core.ProvisionException: No repository found at
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/.
>     at
> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManag
> er.fail(AbstractRepositoryManager.java:395)
>     at
> org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManag
> er.loadRepository(AbstractRepositoryManager.java:692)
>     at
> org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryMana
> ger.loadRepository(ArtifactRepositoryManager.java:104)
>     at
> org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.addRe
> pository(AbstractApplication.java:147)
>     at
> org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication.initi
> alizeRepos(AbstractApplication.java:119)
>     at
> org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication.run(Mir
> rorApplication.java:189)
>     at
> org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication.start(M
> irrorApplication.java:85)
>     at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.jav
> a:196)
> ```
> 
> 
> and
> 
> ```
> mistria@mistria-rh:~/sandbox/mirror$ ~/eclipse/eclipse -application
> org.eclipse.equinox.p2.director -repository
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/ -destination $(pwd) -installIU
> org.eclipse.core.runtime
> ```
> 
> (using director instead of mirror) fails with
> ```
> !ENTRY org.eclipse.equinox.p2.artifact.repository 4 1000 2017-06-26
> 20:30:51.793
> !MESSAGE No repository found at
> file:/home/mistria/git/org.eclipse.epp.packages/packages/org.eclipse.epp.p
> ackage.javascript.product/target/products/epp.package.javascript/linux/gtk
> /x86/eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/epp.package.
> javascript.profile/.
> 
> !ENTRY org.eclipse.equinox.p2.core 4 0 2017-06-26 20:30:52.716
> !MESSAGE Unable to load repositories.
> ```
> 
> 
> I share Roland's analysis there. It looks like the profile directory is a
> good IMetadataRepository, but not a viable IArtifactRepsitory. p2 UI seems
> to have some magic make a p2 repo out of this profile directory. I'll need
> to investigate what this magic is.
> 
> 
> I'll keep you posted.
>