Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
index 52d27b2dc..0f803ccdd 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.p2.core.helpers.*;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
+import org.eclipse.equinox.internal.provisional.frameworkadmin.ConfigData;
import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
@@ -206,6 +207,23 @@ public class Util {
return bundleInfo;
}
+ public static BundleInfo findBundleInfo(ConfigData config, IInstallableUnit unit) {
+ // Construct a partial BundleInfo from the IU capabilities.
+ BundleInfo bundleInfo = Util.createBundleInfo(null, unit);
+
+ // Find the actual fully populated BundleInfo used by the runtime.
+ BundleInfo[] bundles = config.getBundles();
+ for (BundleInfo bundle : bundles) {
+ // Can't use BundleInfol.equals(), because bundleInfo is only partially populated.
+ if (bundleInfo.getSymbolicName().equals(bundle.getSymbolicName())
+ && bundleInfo.getVersion().equals(bundle.getVersion())) {
+ return bundle;
+ }
+ }
+
+ return null;
+ }
+
private static String getFragmentHost(IInstallableUnit unit, String fragmentName) {
Collection<IRequirement> requires = unit.getRequirements();
for (IRequirement iRequirement : requires) {

Back to the top