diff options
author | Simon Kaegi | 2008-08-26 02:55:07 +0000 |
---|---|---|
committer | Simon Kaegi | 2008-08-26 02:55:07 +0000 |
commit | 4d0a61c51529804a1e299d7676757356a89220f8 (patch) | |
tree | 92321dcc4356549653fc0ab1cb1d86d428e28063 | |
parent | ba96996506f563dc1ca8e125d9ea5374be8707ef (diff) | |
download | rt.equinox.p2-4d0a61c51529804a1e299d7676757356a89220f8.tar.gz rt.equinox.p2-4d0a61c51529804a1e299d7676757356a89220f8.tar.xz rt.equinox.p2-4d0a61c51529804a1e299d7676757356a89220f8.zip |
Bug 244630 Unable to invoke product as non-root user after applying product patches.R34x_v20080825
-rw-r--r-- | bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java | 16 |
1 files changed, 13 insertions, 3 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 026d1eed2..ce3f9e25f 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 @@ -216,7 +216,10 @@ public class ProfileSynchronizer { private IStatus synchronizeCacheExtensions() { List currentExtensions = new ArrayList(); StringBuffer buffer = new StringBuffer(); - for (Iterator it = repositoryMap.keySet().iterator(); it.hasNext();) { + + List repositories = new ArrayList(repositoryMap.keySet()); + Collections.sort(repositories); + for (Iterator it = repositories.iterator(); it.hasNext();) { String repositoryId = (String) it.next(); try { IArtifactRepository repository = Activator.loadArtifactRepository(new URL(repositoryId), null); @@ -268,8 +271,11 @@ public class ProfileSynchronizer { toRemove.addAll(collect.toCollection()); //End of backward compatibility + boolean foundIUsToAdd = false; + Collection profileIUs = new HashSet(profile.query(InstallableUnitQuery.ANY, new Collector(), null).toCollection()); + // we use IProfile.available(...) here so that we also gather any shared IUs - Collection profileIUs = new HashSet(profile.available(InstallableUnitQuery.ANY, new Collector(), null).toCollection()); + Collection availableProfileIUs = new HashSet(profile.available(InstallableUnitQuery.ANY, new Collector(), null).toCollection()); // get all IUs from all our repos (toAdd) Collector allIUs = getAllIUsFromRepos(); @@ -284,6 +290,10 @@ public class ProfileSynchronizer { request.setInstallableUnitInclusionRules(iu, PlannerHelper.createOptionalInclusionRule(iu)); request.setInstallableUnitProfileProperty(iu, IInstallableUnit.PROP_PROFILE_LOCKED_IU, Integer.toString(IInstallableUnit.LOCK_UNINSTALL)); toAdd.add(iu); + + if (!foundIUsToAdd && !availableProfileIUs.contains(iu)) { + foundIUsToAdd = true; + } } } @@ -309,7 +319,7 @@ public class ProfileSynchronizer { toRemove.add(iu); } - if (toAdd.isEmpty() && toRemove.isEmpty() && !resolve) + if (!foundIUsToAdd && toRemove.isEmpty() && !resolve) return null; context.setExtraIUs(toAdd); |