|
Lines 418-441
Link Here
|
| 418 |
return null; |
418 |
return null; |
| 419 |
} |
419 |
} |
| 420 |
|
420 |
|
| 421 |
// if we had some bundles which moved locations then we need to create 2 change requests. |
421 |
// if we had some bundles which moved locations then we need to create a move change request |
| 422 |
// one will remove the bundle from the profile and then the other will add it back in |
422 |
// and remove the moved bundles first. The caller of this method will take care of calling us again |
| 423 |
// at the new location |
423 |
// to re-add the bundles at their new location (and other bundles which need adding) |
| 424 |
if (!toMove.isEmpty()) { |
424 |
if (!toMove.isEmpty()) { |
| 425 |
ReconcilerProfileChangeRequest moveRequest = new ReconcilerProfileChangeRequest(profile, true); |
425 |
request = new ReconcilerProfileChangeRequest(profile, true); |
| 426 |
moveRequest.removeAll(toMove); |
426 |
request.removeAll(toMove); |
| 427 |
// force removal of all moved IUs, which will also remove anything which depends on them |
427 |
} |
| 428 |
// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=306424#c6 |
428 |
|
| 429 |
Collection<IRequirement> extraReqs = new ArrayList<IRequirement>(); |
429 |
// force removal of all moved and removed IUs, which will also remove anything which depends on them |
| 430 |
for (IInstallableUnit unit : toMove) { |
430 |
// see: bug 306424#c6 and bug 308934. |
| 431 |
IRequirement negation = MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, unit.getId(), // |
431 |
Collection<IRequirement> extraReqs = new ArrayList<IRequirement>(); |
| 432 |
new VersionRange(unit.getVersion(), true, unit.getVersion(), true), null, 0, 0, false); |
432 |
for (IInstallableUnit unit : request.getRemovals()) { |
| 433 |
extraReqs.add(negation); |
433 |
IRequirement negation = MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, unit.getId(), // |
| 434 |
} |
434 |
new VersionRange(unit.getVersion(), true, unit.getVersion(), true), null, 0, 0, false); |
| 435 |
moveRequest.addExtraRequirements(extraReqs); |
435 |
extraReqs.add(negation); |
| 436 |
debug(request); |
|
|
| 437 |
return moveRequest; |
| 438 |
} |
436 |
} |
|
|
437 |
request.addExtraRequirements(extraReqs); |
| 439 |
|
438 |
|
| 440 |
context.setExtraInstallableUnits(toAdd); |
439 |
context.setExtraInstallableUnits(toAdd); |
| 441 |
request.addAll(toAdd); |
440 |
request.addAll(toAdd); |
|
Lines 518-523
Link Here
|
| 518 |
Tracing.debug(PREFIX + "Removing IU property: " + entry.getKey() + "->" + entry.getValue()); //$NON-NLS-1$ //$NON-NLS-2$ |
517 |
Tracing.debug(PREFIX + "Removing IU property: " + entry.getKey() + "->" + entry.getValue()); //$NON-NLS-1$ //$NON-NLS-2$ |
| 519 |
} |
518 |
} |
| 520 |
} |
519 |
} |
|
|
520 |
|
| 521 |
Collection<IRequirement> extra = request.getExtraRequirements(); |
| 522 |
if (extra == null || extra.isEmpty()) { |
| 523 |
Tracing.debug(PREFIX + "No extra requirements."); //$NON-NLS-1$ |
| 524 |
} else { |
| 525 |
for (IRequirement requirement : extra) |
| 526 |
Tracing.debug(PREFIX + "Extra requirement: " + requirement); //$NON-NLS-1$ |
| 527 |
} |
| 521 |
} |
528 |
} |
| 522 |
|
529 |
|
| 523 |
/* |
530 |
/* |