Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2009-03-10 21:44:59 +0000
committerAndrew Niefer2009-03-10 21:44:59 +0000
commited422e3d0b63b1b6b146d5d4151795d21a45ba7e (patch)
treec4e31aa6429fd768fab13adc75b19dd52796a77f /bundles
parent64915e44024b43e21233dd9ba548220257b5d608 (diff)
downloadrt.equinox.p2-ed422e3d0b63b1b6b146d5d4151795d21a45ba7e.tar.gz
rt.equinox.p2-ed422e3d0b63b1b6b146d5d4151795d21a45ba7e.tar.xz
rt.equinox.p2-ed422e3d0b63b1b6b146d5d4151795d21a45ba7e.zip
bug 267972 - no filters on product IUv20090310-1840
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java29
1 files changed, 13 insertions, 16 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java
index 724c09756..45bc9174e 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java
@@ -143,28 +143,25 @@ public class ProductAction extends AbstractPublisherAction {
List result = new ArrayList();
for (Iterator i = elements.iterator(); i.hasNext();) {
VersionedName element = (VersionedName) i.next();
- if (element.getVersion() == null || Version.emptyVersion.equals(element.getVersion())) {
+ Version elementVersion = element.getVersion();
+ if (elementVersion == null || Version.emptyVersion.equals(elementVersion)) {
Iterator advice = versionAdvice.iterator();
- Version advisedVersion = null;
while (advice.hasNext()) {
- advisedVersion = ((VersionAdvice) advice.next()).getVersion(namespace, element.getId());
+ elementVersion = ((VersionAdvice) advice.next()).getVersion(namespace, element.getId());
break;
}
-
- if (advisedVersion != null) {
- result.add(new VersionedName(element.getId(), advisedVersion));
- continue;
- }
-
- // no advice, find highest version
- IInstallableUnit unit = queryForIU(publisherResults, element.getId(), null);
- if (unit != null) {
- result.add(unit);
- continue;
- }
}
- result.add(element);
+ // if advisedVersion is null, we get the highest version
+ IInstallableUnit unit = queryForIU(publisherResults, element.getId(), elementVersion);
+ if (unit != null) {
+ result.add(unit);
+ } else if (elementVersion != null) {
+ //best effort
+ result.add(new VersionedName(element.getId(), elementVersion));
+ }
+ //TODO we could still add a requirement on version 0.0.0 to get any version, but if the
+ //bundle is platform specific we will have broken metadata due to a missing filter
}
return result;
}

Back to the top