Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2012-11-25 05:02:52 +0000
committerPascal Rapicault2012-11-25 05:19:09 +0000
commit3bf447faf9eaccac362a219a6e4f804698e81840 (patch)
tree2ffe1edf814c6bceaf447aa7446510127f944ea1 /bundles/org.eclipse.equinox.p2.ui
parenta00790dcb5cd1b944a818c0770501cf213fafb7f (diff)
downloadrt.equinox.p2-3bf447faf9eaccac362a219a6e4f804698e81840.tar.gz
rt.equinox.p2-3bf447faf9eaccac362a219a6e4f804698e81840.tar.xz
rt.equinox.p2-3bf447faf9eaccac362a219a6e4f804698e81840.zip
Bug 394156 - Add support for updates from one namespacev20121125-051909
to another
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java19
2 files changed, 10 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF
index 478ac385c..edbfa0420 100644
--- a/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.equinox.p2.ui;singleton:=true
-Bundle-Version: 2.2.0.qualifier
+Bundle-Version: 2.2.100.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.ui.ProvUIActivator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java
index 1bc569d92..1d76e1c22 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* EclipseSource - ongoing development
+ * Rapicorp, Inc (Pascal Rapicault) - Bug 394156 - Add support for updates from one namespace to another
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.query;
@@ -17,9 +18,10 @@ import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
import org.eclipse.equinox.internal.p2.ui.model.*;
import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
-import org.eclipse.equinox.p2.query.*;
+import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.query.QueryUtil;
/**
* A wrapper that examines available IU's and wraps them in an
@@ -82,18 +84,15 @@ public class AvailableIUWrapper extends QueriedElementWrapper {
private InformationCache computeIUInformation(IInstallableUnit iu) {
boolean isUpdate = false;
boolean isInstalled = false;
- boolean isPatch = iu == null ? false : Boolean.valueOf(iu.getProperty(InstallableUnitDescription.PROP_TYPE_PATCH));
+ boolean isPatch = iu == null ? false : QueryUtil.isPatch(iu);
if (profile != null && iu != null) {
- IQueryResult<IInstallableUnit> queryResult = profile.query(QueryUtil.createIUQuery(iu.getId()), null);
- Iterator<IInstallableUnit> iter = queryResult.iterator();
- // We are typically iterating over only one IU unless it's a non-singleton.
+ isInstalled = !profile.query(QueryUtil.createIUQuery(iu), null).isEmpty();
+ Iterator<IInstallableUnit> iter = profile.query(new UserVisibleRootQuery(), null).iterator();
while (iter.hasNext()) {
IInstallableUnit installed = iter.next();
- if (installed.getVersion().compareTo(iu.getVersion()) < 0)
+ if (iu.getUpdateDescriptor() != null && iu.getUpdateDescriptor().isUpdateOf(installed)) {
isUpdate = true;
- else {
- isUpdate = false;
- isInstalled = true;
+ break;
}
}
}

Back to the top