diff options
author | Pascal Rapicault | 2010-08-22 23:11:41 +0000 |
---|---|---|
committer | Pascal Rapicault | 2010-08-22 23:11:41 +0000 |
commit | 00821620a73a67f4e9153b0e522849be1c5e5b3e (patch) | |
tree | bb43d11b28f04b8b3dfc13b209adb8549342d685 /bundles | |
parent | 6de0c00fac6a7216f94755d179d239c587b9e0b9 (diff) | |
download | rt.equinox.p2-00821620a73a67f4e9153b0e522849be1c5e5b3e.tar.gz rt.equinox.p2-00821620a73a67f4e9153b0e522849be1c5e5b3e.tar.xz rt.equinox.p2-00821620a73a67f4e9153b0e522849be1c5e5b3e.zip |
Bug 323319 - [planner] Non greedy handling in the slicer brings in complete repositories
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java index a7dd4aa6f..b9544ac88 100644 --- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java +++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java @@ -64,6 +64,7 @@ public class Slicer { } processIU(toProcess.removeFirst()); } + computeNonGreedyIUs(); if (DEBUG) { long stop = System.currentTimeMillis(); System.out.println("Slicing complete: " + (stop - start)); //$NON-NLS-1$ @@ -78,6 +79,22 @@ public class Slicer { return new QueryableArray(considered.toArray(new IInstallableUnit[considered.size()])); } + private void computeNonGreedyIUs() { + IQueryable<IInstallableUnit> queryable = new QueryableArray(considered.toArray(new IInstallableUnit[considered.size()])); + Iterator<IInstallableUnit> it = queryable.query(QueryUtil.ALL_UNITS, new NullProgressMonitor()).iterator(); + while (it.hasNext()) { + Collection<IRequirement> reqs = getRequirements(it.next().unresolved()); + for (IRequirement req : reqs) { + if (!isApplicable(req)) + continue; + + if (!isGreedy(req)) { + nonGreedyIUs.addAll(queryable.query(QueryUtil.createMatchQuery(req.getMatches()), null).toUnmodifiableSet()); + } + } + } + } + public MultiStatus getStatus() { return result; } @@ -123,7 +140,6 @@ public class Slicer { continue; if (!isGreedy(req)) { - nonGreedyIUs.addAll(possibilites.query(QueryUtil.createMatchQuery(req.getMatches()), null).toUnmodifiableSet()); continue; } |