Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2008-01-25 16:41:26 +0000
committerSimon Kaegi2008-01-25 16:41:26 +0000
commit4d563669c60bfb8711fba2c6584a1e6c10d9d918 (patch)
tree1cef17cb2992f453c6d8681ba80a9b55e159e4d7 /bundles/org.eclipse.equinox.p2.console
parentc780fbc3fbab82adb969fc51fea05774dc0dd8ca (diff)
downloadrt.equinox.p2-4d563669c60bfb8711fba2c6584a1e6c10d9d918.tar.gz
rt.equinox.p2-4d563669c60bfb8711fba2c6584a1e6c10d9d918.tar.xz
rt.equinox.p2-4d563669c60bfb8711fba2c6584a1e6c10d9d918.zip
Bug 206077
[prov] Should we have a ProfileDelta in a provisioning plan and an associated engine phase for applying it?
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.console')
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
index 3c6a08440..5d33e0054 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
@@ -12,8 +12,7 @@ package org.eclipse.equinox.internal.p2.console;
import java.io.IOException;
import java.net.URL;
-import java.util.Iterator;
-import java.util.Properties;
+import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.configurator.Configurator;
@@ -83,7 +82,7 @@ public class ProvisioningHelper {
// could not load a repo at that location so create one as a convenience
String repositoryName = location + " - artifacts"; //$NON-NLS-1$
try {
- return manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY);
+ return manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY);
} catch (ProvisionException e) {
return null;
}
@@ -105,21 +104,21 @@ public class ProvisioningHelper {
if (profile != null)
return profile;
- profile = new Profile(profileId);
+ Map profileProperties = new HashMap();
for (Iterator it = properties.keySet().iterator(); it.hasNext();) {
String key = (String) it.next();
- profile.setValue(key, properties.getProperty(key));
+ profileProperties.put(key, properties.getProperty(key));
}
if (profile.getValue(Profile.PROP_ENVIRONMENTS) == null) {
EnvironmentInfo info = (EnvironmentInfo) ServiceHelper.getService(Activator.getContext(), EnvironmentInfo.class.getName());
if (info != null)
- profile.setValue(Profile.PROP_ENVIRONMENTS, "osgi.os=" + info.getOS() + ",osgi.ws=" + info.getWS() + ",osgi.arch=" + info.getOSArch());
+ profileProperties.put(Profile.PROP_ENVIRONMENTS, "osgi.os=" + info.getOS() + ",osgi.ws=" + info.getWS() + ",osgi.arch=" + info.getOSArch());
else
- profile.setValue(Profile.PROP_ENVIRONMENTS, "");
+ profileProperties.put(Profile.PROP_ENVIRONMENTS, "");
}
-
+ profile = new Profile(profileId, null, profileProperties);
profileRegistry.addProfile(profile);
return profile;
}
@@ -203,11 +202,14 @@ public class ProvisioningHelper {
if (engine == null)
throw new ProvisionException("No director service found.");
IInstallableUnit[] toInstall = (IInstallableUnit[]) units.toArray(IInstallableUnit.class);
- ProvisioningPlan result = planner.getInstallPlan(toInstall, profile, null, progress);
+ ProvisioningContext context = new ProvisioningContext();
+ ProfileChangeRequest request = new ProfileChangeRequest(profile.getProfileId());
+ request.addInstallableUnits(toInstall);
+ ProvisioningPlan result = planner.getProvisioningPlan(request, context, progress);
if (!result.getStatus().isOK())
return result.getStatus();
- return engine.perform(profile, new DefaultPhaseSet(), result.getOperands(), progress);
+ return engine.perform(profile, new DefaultPhaseSet(), result.getOperands(), result.getPropertyOperands(), progress);
}
/**

Back to the top