Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2013-12-13 15:40:46 +0000
committerKrzysztof Daniel2013-12-17 15:22:28 +0000
commit73e3365d5687050be42fe7484560230fc36a99be (patch)
treef83b4c184fc2c78a0f78bc21f91feaaa695ff11e /bundles/org.eclipse.equinox.p2.director.app/src/org
parent39da65192fec835fafe75c0f863a63757b59f2dd (diff)
downloadrt.equinox.p2-73e3365d5687050be42fe7484560230fc36a99be.tar.gz
rt.equinox.p2-73e3365d5687050be42fe7484560230fc36a99be.tar.xz
rt.equinox.p2-73e3365d5687050be42fe7484560230fc36a99be.zip
Bug 422054: Create profile from existing bundles.infoI20131224-0800
I've hijacked the bug for the purpose of something that is remotely connected to the problem. Previous commit extends simpleconfigurator to load bundles from different locations, but such an extension breaks p2, as the content of OSGi application no longer corresponds to profile. In order to fix that, following things are done: 0. A fragment must contain valid P2 metadata next to the .info file. 1. User profile is dropped when there is master configuration change. Also, when fragments are changed. 2. When a new surrogate profile is created, P2 will add to the master profile all the units that are found in the fragments repos. Therefore new user profile will contain all the units that were installed by the simpleconfigurator. Fragment repos must be runnable. 3. The director application must be configured with extensions if it is supposed to work. Change-Id: I6e857ea51dd32ae7fab39d9c39bec8a91eb203b7 Signed-off-by: Krzysztof Daniel <kdaniel@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director.app/src/org')
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
index 7fdf9a9a4..d2772531c 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
* EclipseSource - ongoing development
* Sonatype, Inc. - ongoing development
* Pascal Rapicault - Support for bundled macosx http://bugs.eclipse.org/57349
+ * Red Hat, Inc. - support repositories passed via fragments (see bug 378329).
*******************************************************************************/
package org.eclipse.equinox.internal.p2.director.app;
@@ -25,6 +26,7 @@ import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.equinox.internal.p2.core.helpers.*;
import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
+import org.eclipse.equinox.internal.p2.engine.EngineActivator;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener;
import org.eclipse.equinox.internal.provisional.p2.director.IDirector;
@@ -566,6 +568,20 @@ public class DirectorApplication implements IApplication, ProvisioningListener {
if (!anyValid)
//all repositories failed to load
throw new ProvisionException(Messages.Application_NoRepositories);
+
+ if (!EngineActivator.EXTENDED)
+ return;
+
+ File[] extensions = EngineActivator.getExtensionsDirectories();
+
+ for (File f : extensions) {
+ metadataManager.addRepository(f.toURI());
+ metadataManager.setRepositoryProperty(f.toURI(), EngineActivator.P2_FRAGMENT_PROPERTY, Boolean.TRUE.toString());
+ metadataRepositoryLocations.add(f.toURI());
+ artifactManager.addRepository(f.toURI());
+ artifactManager.setRepositoryProperty(f.toURI(), EngineActivator.P2_FRAGMENT_PROPERTY, Boolean.TRUE.toString());
+ artifactRepositoryLocations.add(f.toURI());
+ }
}
private void initializeServices() throws CoreException {

Back to the top