Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Managing available software sites
Managing available software sites [message #509939] Mon, 25 January 2010 20:07 Go to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 952
Registered: July 2009
Senior Member
I'd like to know how one can manage the list of available software sites (update sites) programmatically when one is putting together an Eclipse distro. I need to be able to enable/disable update site and ideally remove some too.

Thanks,

- Konstantin
Re: Managing available software sites [message #510078 is a reply to message #509939] Tue, 26 January 2010 13:40 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Konstantin Komissarchik wrote:
> I'd like to know how one can manage the list of available software sites
> (update sites) programmatically when one is putting together an Eclipse
> distro. I need to be able to enable/disable update site and ideally
> remove some too.

Programmitically, it looks like
org.eclipse.equinox.internal.provisional.p2.ui.policy.Policy can be used
(retrieved as an OSGi service) ... RepositoryManipulator can be used to
add and remove repos, and a default implementation is already available
if you are building on the eclipse SDK (I've never tried this).

For creating a distro with p2 (especially if you control the product)
you can use touchpoints in an p2.inf file to add and remove
repositories. For example:

instructions.configure=\
addRepository(type:0,location:http${#58}//download.eclipse.o rg/eclipse/updates/3.6-I-builds,name:Eclipse
3.6 I-builds);\
addRepository(type:1,location:http${#58}//download.eclipse.o rg/eclipse/updates/3.6-I-builds,name:Eclipse
3.6 I-builds);\
mkdir(path:${installFolder}/dropins);

See http://wiki.eclipse.org/Equinox/p2/Engine/Touchpoint_Instruc tions
for a list of touchpoints.

There's also info on the RCP example page,
http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_ RCP_Application#Configuring_the_user.27s_default_repositorie s

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Managing available software sites [message #510226 is a reply to message #510078] Tue, 26 January 2010 19:05 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 952
Registered: July 2009
Senior Member
Paul,

Thanks for your reply. I am interested in pursuing the p2.inf / touchpoint approach that you described, but I have not been able to figure out what to do with p2.inf file once I have it. Found some references to placing it inside the bundle or a feature, but that would have the effect of making these changes even when our product is installed via an update site (not what what we want).

We are currently packaging "all-in-one" kits by laying down the platform and then putting all of the add-on components into the dropins folder. We then zip up the result and distribute it.

Is there a command we can run after laying everything down that would apply stuff in a p2.inf file?

How do we make sure that p2 has a chance to process stuff in the dropins folder before we apply our p2.inf file? The removeRepository commands that we need to run have to apply after stuff in the dropins folder had made its contribution.

Is there any information you could point me to that would describe how to create distros in the "p2 way".

- Konstantin
Re: Managing available software sites [message #510531 is a reply to message #510226] Wed, 27 January 2010 18:19 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Konstantin Komissarchik wrote:
> Paul,
>
> Thanks for your reply. I am interested in pursuing the p2.inf /
> touchpoint approach that you described, but I have not been able to
> figure out what to do with p2.inf file once I have it.

> Is there a command we can run after laying everything down that would
> apply stuff in a p2.inf file?

I haven't seen an application that could just run instructions, although
there might be a way to build something like that using the p2
provisional APIs ... I've never touched them myself.

>
> How do we make sure that p2 has a chance to process stuff in the dropins
> folder before we apply our p2.inf file? The removeRepository commands
> that we need to run have to apply after stuff in the dropins folder had
> made its contribution.

I think you might have to create a "distro feature" (or IU) that you
would only include when building the zipped distro and not publish to
your update sites.

The underhanded way to get it to work is to have your distro feature
actually include the p2.inf file (the p2 folks frowned at me, though :-)
Slap the distro feature in there when creating your dropins and away
you go. If you can make your distro feature depend on one of your
containing product/functionality features, then hopefully it won't have
any processing problems.

The downside is this feature shows up in the About dialog installed
software and features tabs. There's a way to just create the IU so that
it only shows up on the Installed Software tab, not the Features tab
(but you need to install using the director).

The full p2.inf I used that worked on 3.5.1 was:

instructions.configure=\
addRepository(type:0,location:http${#58}//download.eclipse.o rg/eclipse/updates/3.6-I-builds,name:Eclipse
3.6 I-builds);\
addRepository(type:1,location:http${#58}//download.eclipse.o rg/eclipse/updates/3.6-I-builds,name:Eclipse
3.6 I-builds);\
removeRepository(type:0,location:http${#58}//download.eclips e.org/releases/galileo);\
removeRepository(type:1,location:http${#58}//download.eclips e.org/releases/galileo);
instructions.configure.import=\
org.eclipse.equinox.p2.touchpoint.eclipse.addRepository,\
org.eclipse.equinox.p2.touchpoint.eclipse.removeRepository


>
> Is there any information you could point me to that would describe how
> to create distros in the "p2 way".

I haven't noticed an "assembling tutorial", sorry. I do know that the
director is the application that p2 uses to install features or build
complete applications from the command line.
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/p2_director.html

If you are already creating update sites for your features, the director
can easily install them all into an SDK for you from the command line.
The example I used in testing (I had the EMF Update site in a local zip)
is to unzip an SDK target and then:

releng/eclipse/eclipse -application org.eclipse.equinox.p2.director \
-noSplash --launcher.suppressErrors -consoleLog \
-flavor tooling -p2.os linux -p2.ws gtk -p2.arch x86 \
-roaming -profile SDKProfile \
-repository jar:file:/tmp/sites/emf-xsd-Update-2.5.0.zip\!/ \
-destination target/eclipse \
-installIUs org.eclipse.emf.sdk.feature.group

My target/eclipse install is now the SDK + the EMF SDK. By fiddling
with the repositories (you can specify more than one) and the IUs you
can install a combination of things at once.

I hope that helps, good luck.

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Tomcat in Equinox
Next Topic:custom touchpoint action troubles
Goto Forum:
  


Current Time: Fri Nov 28 12:38:14 GMT 2014

Powered by FUDForum. Page generated in 0.02565 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software