Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-12-15 06:44:51 +0000
committerAlexander Kurtakov2017-12-15 06:44:51 +0000
commita24a7104a45101b52fd3f2b5382f7722d1c314d7 (patch)
tree48b1c542a8d9e39dd85c85674f0c829bef42d993 /bundles/org.eclipse.equinox.p2.publisher
parent07c80afa6a12b3170e1b6b1dd5b7dadc775a501e (diff)
downloadrt.equinox.p2-a24a7104a45101b52fd3f2b5382f7722d1c314d7.tar.gz
rt.equinox.p2-a24a7104a45101b52fd3f2b5382f7722d1c314d7.tar.xz
rt.equinox.p2-a24a7104a45101b52fd3f2b5382f7722d1c314d7.zip
Revert "Revert "Bug 528494 - Using the match operator for RequiredCapability""I20171215-0930I20171215-0215
This reverts commit 07c80afa6a12b3170e1b6b1dd5b7dadc775a501e. Revert the revert - issue is with multiple layers of features they need manual touching. Change-Id: I3b4b8f2d64ed02d79ffd7bd9c7c5b85b45f8bd21
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.publisher')
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java31
1 files changed, 22 insertions, 9 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java
index 7e462e735..8fc15de68 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Genuitec, LLC - added license support
@@ -46,14 +46,14 @@ public class PublisherHelper {
public static final String NAMESPACE_FLAVOR = "org.eclipse.equinox.p2.flavor"; //$NON-NLS-1$"
/**
- * A capability name in the {@link #NAMESPACE_ECLIPSE_TYPE} namespace
+ * A capability name in the {@link #NAMESPACE_ECLIPSE_TYPE} namespace
* representing a feature
* @see IProvidedCapability#getName()
*/
public static final String TYPE_ECLIPSE_FEATURE = "feature"; //$NON-NLS-1$
/**
- * A capability name in the {@link #NAMESPACE_ECLIPSE_TYPE} namespace
+ * A capability name in the {@link #NAMESPACE_ECLIPSE_TYPE} namespace
* representing a source bundle
* @see IProvidedCapability#getName()
*/
@@ -214,22 +214,35 @@ public class PublisherHelper {
* @return The created omni version
*/
public static Version fromOSGiVersion(org.osgi.framework.Version version) {
- if (version == null)
- return null;
- if (version.getMajor() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE)
+ if (version == null) {
return Version.MAX_VERSION;
+ }
+ if (version.getMajor() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE) {
+ return Version.MAX_VERSION;
+ }
return Version.createOSGi(version.getMajor(), version.getMinor(), version.getMicro(), version.getQualifier());
}
public static org.eclipse.osgi.service.resolver.VersionRange toOSGiVersionRange(VersionRange range) {
- if (range.equals(VersionRange.emptyRange))
+ if (range.equals(VersionRange.emptyRange)) {
return org.eclipse.osgi.service.resolver.VersionRange.emptyRange;
+ }
return new org.eclipse.osgi.service.resolver.VersionRange(toOSGiVersion(range.getMinimum()), range.getIncludeMinimum(), toOSGiVersion(range.getMaximum()), range.getIncludeMinimum());
}
public static VersionRange fromOSGiVersionRange(org.eclipse.osgi.service.resolver.VersionRange range) {
- if (range.equals(org.eclipse.osgi.service.resolver.VersionRange.emptyRange))
+ if (range.equals(org.eclipse.osgi.service.resolver.VersionRange.emptyRange)) {
return VersionRange.emptyRange;
- return new VersionRange(fromOSGiVersion(range.getMinimum()), range.getIncludeMinimum(), fromOSGiVersion(range.getMaximum()), range.getIncludeMaximum());
+ }
+
+ Version min = fromOSGiVersion(range.getLeft());
+ boolean includeMin = range.getIncludeMinimum();
+
+ Version max = fromOSGiVersion(range.getRight());
+ // TODO The OSGi open ended range does not include the max value, where as the p2 does
+ // Fix the p2 range to not include maximum as well (how will this affect the projector)?.
+ boolean includeMax = Version.MAX_VERSION.equals(max) ? true : range.getIncludeMaximum();
+
+ return new VersionRange(min, includeMin, max, includeMax);
}
}

Back to the top