Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2009-03-03 23:34:46 +0000
committerSimon Kaegi2009-03-03 23:34:46 +0000
commit7a122c509d2c4a1a8f463b78a0701f11f5dd148f (patch)
tree38fcc8df49dbbdb2d96d16badd6aa60acc91ae79 /bundles/org.eclipse.equinox.p2.reconciler.dropins
parentfd62c5bf95990c1c2c07854ff1eed9abc73e6300 (diff)
downloadrt.equinox.p2-7a122c509d2c4a1a8f463b78a0701f11f5dd148f.tar.gz
rt.equinox.p2-7a122c509d2c4a1a8f463b78a0701f11f5dd148f.tar.xz
rt.equinox.p2-7a122c509d2c4a1a8f463b78a0701f11f5dd148f.zip
Bug 258178 [reconciler] Make sure reconciler does not cause spurious engine operations
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.reconciler.dropins')
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java41
1 files changed, 29 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
index 9cae39128..70ccfff09 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
@@ -78,7 +78,10 @@ public class ProfileSynchronizer {
if (request == null) {
if (updatedCacheExtensions != null) {
Operand operand = new PropertyOperand(CACHE_EXTENSIONS, null, updatedCacheExtensions);
- return executeOperands(new Operand[] {operand}, context, null);
+ IStatus engineResult = executeOperands(new Operand[] {operand}, context, null);
+ if (engineResult.getSeverity() != IStatus.ERROR && engineResult.getSeverity() != IStatus.CANCEL)
+ writeTimestamps();
+ return engineResult;
}
return Status.OK_STATUS;
}
@@ -89,18 +92,22 @@ public class ProfileSynchronizer {
try {
//create the provisioning plan
ProvisioningPlan plan = createProvisioningPlan(request, context, sub.newChild(50));
-
IStatus status = plan.getStatus();
- if (status.getSeverity() == IStatus.ERROR || plan.getStatus().getSeverity() == IStatus.CANCEL || plan.getOperands().length == 0)
+ if (status.getSeverity() == IStatus.ERROR || plan.getStatus().getSeverity() == IStatus.CANCEL)
return status;
- //invoke the engine to perform installs/uninstalls
- IStatus engineResult = executePlan(plan, context, sub.newChild(50));
+ Operand[] operands = plan.getOperands();
+ if (operands.length == 0 || containsOnlyInstallableUnitPropertyOperandAdditions(operands)) {
+ writeTimestamps();
+ return status;
+ }
- if (!engineResult.isOK())
+ //invoke the engine to perform installs/uninstalls
+ IStatus engineResult = executeOperands(operands, context, sub.newChild(50));
+ if (status.getSeverity() == IStatus.ERROR || plan.getStatus().getSeverity() == IStatus.CANCEL)
return engineResult;
- writeTimestamps();
+ writeTimestamps();
applyConfiguration();
return status;
@@ -109,6 +116,21 @@ public class ProfileSynchronizer {
}
}
+ // This is a special case that occurs where all IUs being installed are not compatible with the profile so
+ // the operands will have no affect if executed on the profile.
+ private boolean containsOnlyInstallableUnitPropertyOperandAdditions(Operand[] operands) {
+ for (int i = 0; i < operands.length; i++) {
+ if (!(operands[i] instanceof InstallableUnitPropertyOperand))
+ return false;
+
+ InstallableUnitPropertyOperand iuPropertyOperand = (InstallableUnitPropertyOperand) operands[i];
+ //check if this is a removal or update
+ if (iuPropertyOperand.first() != null)
+ return false;
+ }
+ return true;
+ }
+
private void writeTimestamps() {
timestamps.clear();
timestamps.put(PROFILE_TIMESTAMP, Long.toString(profile.getTimestamp()));
@@ -415,11 +437,6 @@ public class ProfileSynchronizer {
}
}
- private IStatus executePlan(ProvisioningPlan plan, ProvisioningContext provisioningContext, IProgressMonitor monitor) {
- Operand[] operands = plan.getOperands();
- return executeOperands(operands, provisioningContext, monitor);
- }
-
private IStatus executeOperands(Operand[] operands, ProvisioningContext provisioningContext, IProgressMonitor monitor) {
BundleContext context = Activator.getContext();
ServiceReference reference = context.getServiceReference(IEngine.class.getName());

Back to the top