|
Lines 51-63
Link Here
|
| 51 |
// If the iu is a newer version of something already installed, consider this an |
51 |
// If the iu is a newer version of something already installed, consider this an |
| 52 |
// update request |
52 |
// update request |
| 53 |
if (compareTo > 0) { |
53 |
if (compareTo > 0) { |
| 54 |
request.addInstallableUnits(new IInstallableUnit[] {ius[i]}); |
54 |
int lock = getLock(profile, installedIU); |
| 55 |
request.removeInstallableUnits(new IInstallableUnit[] {installedIU}); |
55 |
// If it is locked for update, we don't allow it. |
| 56 |
// Mark it as a root if it hasn't been already |
56 |
if ((lock & IInstallableUnit.LOCK_UPDATE) == IInstallableUnit.LOCK_UPDATE) { |
| 57 |
if (!Boolean.toString(true).equals(profile.getInstallableUnitProperty(installedIU, IInstallableUnit.PROP_PROFILE_ROOT_IU))) |
57 |
// Tell the user it's already installed. |
| 58 |
request.setInstallableUnitProfileProperty(ius[i], IInstallableUnit.PROP_PROFILE_ROOT_IU, Boolean.toString(true)); |
58 |
// TODO this would seem odd if the user didn't know they had it installed. If it's not marked |
| 59 |
// Add a status informing the user that the update has been inferred |
59 |
// as a root, they can't see it. But silently marking it as a root as we do when the versions are the |
| 60 |
additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IMPLIED_UPDATE, ius[i])); |
60 |
// same would make it look like we installed the wrong version. And a message saying, "you didn't know |
|
|
61 |
// this, but you already have an older version of this installed" is not so great either. |
| 62 |
additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IGNORED_ALREADY_INSTALLED, ius[i])); |
| 63 |
} else { |
| 64 |
request.addInstallableUnits(new IInstallableUnit[] {ius[i]}); |
| 65 |
request.removeInstallableUnits(new IInstallableUnit[] {installedIU}); |
| 66 |
// Mark it as a root if it hasn't been already |
| 67 |
if (!Boolean.toString(true).equals(profile.getInstallableUnitProperty(installedIU, IInstallableUnit.PROP_PROFILE_ROOT_IU))) |
| 68 |
request.setInstallableUnitProfileProperty(ius[i], IInstallableUnit.PROP_PROFILE_ROOT_IU, Boolean.toString(true)); |
| 69 |
// Add a status informing the user that the update has been inferred |
| 70 |
additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IMPLIED_UPDATE, ius[i])); |
| 71 |
} |
| 61 |
} else if (compareTo < 0) { |
72 |
} else if (compareTo < 0) { |
| 62 |
// An implied downgrade. We will not put this in the plan, add a status informing the user |
73 |
// An implied downgrade. We will not put this in the plan, add a status informing the user |
| 63 |
additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IGNORED_IMPLIED_DOWNGRADE, ius[i])); |
74 |
additionalStatus.merge(PlanStatusHelper.getStatus(IStatusCodes.IGNORED_IMPLIED_DOWNGRADE, ius[i])); |