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

Bug 269843

Summary: Can a feature remove a repo reference made by a product
Product: [Eclipse Project] Equinox Reporter: Susan McCourt <susan>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: divers, john.arthorne, pascal, samuelwu, simon_kaegi, susan
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Susan McCourt CLA 2009-03-24 12:34:00 EDT
+++ This bug was initially created as a clone of Bug #242396 +++

Build ID: Build id: M20080723-0800

Steps To Reproduce:
As a product built on top of Eclipse and contain many components, we need all the components to be at a specific level to keep the integration of the product. To allow the components to update themselves may break the product. The Update Manager provides a nested feature structure and the top feature can control the update for all the children features. In the current P2, the repositories of all the components are exposed to the user. We need a way to hide the repositories of all the components and only expose the product repository.


More information:
Comment 1 Susan McCourt CLA 2009-03-24 12:36:11 EDT
Comment from Samuel Wu in other bug:

Tried to the following on eclipse 3.5M6 without success.

1. Create a file p2.inf in the directory META-INF in my feature with the
following content
instructions.install = \
        removeRepository (http://download.eclipse.org/datatools/updates,1);\
        removeRepository (http://download.eclipse.org/datatools/updates,0);
2. Create an update site to build and host the feature
3. Install the feature in another instance of eclipse
3. Open the available software sites and the site
http://download.eclipse.org/datatools/updates still exists.
I also tried to put this file p2.inf in the directory META-INF of a plugin and
it doesn't seem to work either.
Comment 2 Susan McCourt CLA 2009-03-24 12:50:43 EDT
As I understood the original request, 
1 - the product would expose a product repository that pointed to a specific repo owned by the product.  
2 - Users should not be able to add any repos
3 - references to update sites by features that compose the product would not appear.

#1 is accomplished by adding the product repository in the p2.inf of the product build.  This also implies that the Ganymede (Galileo) or current release train repo is *not* included in the product build. 

#2 is accomplished as described in http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_RCP_Application#Updating_from_the_Cloud

#3 sounds like what your experiments were trying to address.  cc'ing John, Pascal, and Simon because they know more about this part of the problem than I do.
Comment 3 Simon Kaegi CLA 2009-03-24 13:03:30 EDT
(In reply to comment #1)
> Comment from Samuel Wu in other bug:
> Tried to the following on eclipse 3.5M6 without success.
> 1. Create a file p2.inf in the directory META-INF in my feature with the
> following content
> instructions.install = \
>         removeRepository (http://download.eclipse.org/datatools/updates,1);\
>         removeRepository (http://download.eclipse.org/datatools/updates,0);
> 2. Create an update site to build and host the feature
> 3. Install the feature in another instance of eclipse
> 3. Open the available software sites and the site
> http://download.eclipse.org/datatools/updates still exists.
> I also tried to put this file p2.inf in the directory META-INF of a plugin and
> it doesn't seem to work either.

One thing I can see is that your action syntax is not correct
Please see http://wiki.eclipse.org/Equinox_p2_Touchpoint_Instructions
1) You need to use parameter names (in this case location and type)
2) You need to encode the ":" character.

I think what you want instead is:
removeRepository(location:http${#58}download.eclipse.org/datatools/updates, type:1);

Comment 4 Samuel Wu CLA 2009-03-24 14:38:02 EDT
I updated the syntax but it still failed to remove the repository.
Comment 5 Simon Kaegi CLA 2009-03-24 16:55:38 EDT
Indeed. You might not realize it but you're riding the bleeding edge.

The p2.inf support for features is now available in the "publisher" however we have not made the move to use it yet since we have to sort out how the main eclipe build will operate with it. In addition it is still a bit unclear (at least to me) if using the remove repo action will really work in this case since the parsing of the feature at a later point might add it back.