0199501
From ea1cb133841d9b2d9cb6fb7d8cf8fdb0d1095347 Mon Sep 17 00:00:00 2001
0199501
From: Roland Grunberg <rgrunber@redhat.com>
0199501
Date: Thu, 7 Apr 2016 10:23:49 -0400
0199501
Subject: [PATCH] Support reading BundleInfo from p2 Droplets enabled
0199501
 installations.
0199501
0199501
---
0199501
 ui/org.eclipse.pde.core/META-INF/MANIFEST.MF                     | 3 ++-
0199501
 .../src/org/eclipse/pde/internal/core/P2Utils.java               | 9 ++++++++-
0199501
 2 files changed, 10 insertions(+), 2 deletions(-)
0199501
0199501
diff --git eclipse.pde.ui/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF eclipse.pde.ui/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
0199501
index 7c20994..ab702e3 100644
0199501
--- eclipse.pde.ui/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
0199501
+++ eclipse.pde.ui/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
0199501
@@ -102,5 +102,6 @@ Require-Bundle:
0199501
  org.eclipse.core.filesystem;bundle-version="[1.0.0,2.0.0)"
0199501
 Eclipse-LazyStart: true
0199501
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
0199501
-Import-Package: com.ibm.icu.util
0199501
+Import-Package: com.ibm.icu.util,
0199501
+ org.eclipse.equinox.internal.simpleconfigurator.utils
0199501
 Bundle-ActivationPolicy: lazy
0199501
diff --git eclipse.pde.ui/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/P2Utils.java eclipse.pde.ui/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/P2Utils.java
0199501
index fbd4b81..ce4589d 100644
0199501
--- eclipse.pde.ui/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/P2Utils.java
0199501
+++ eclipse.pde.ui/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/P2Utils.java
0199501
@@ -17,6 +17,8 @@ import java.net.URL;
0199501
 import java.util.*;
0199501
+import java.net.URI;
0199501
 import org.eclipse.core.runtime.*;
0199501
 import org.eclipse.equinox.frameworkadmin.BundleInfo;
0199501
+import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils;
0199501
 import org.eclipse.equinox.p2.core.IProvisioningAgent;
0199501
 import org.eclipse.equinox.p2.core.IProvisioningAgentProvider;
0199501
 import org.eclipse.equinox.p2.engine.*;
0199501
@@ -108,7 +109,16 @@ public class P2Utils {
0199501
 		try {
0199501
 			URL bundlesTxt = new URL(configurationArea.getProtocol(), configurationArea.getHost(), new File(configurationArea.getFile(), SimpleConfiguratorManipulator.BUNDLES_INFO_PATH).getAbsolutePath());
0199501
 			File home = basePath.toFile();
0199501
-			BundleInfo bundles[] = getBundlesFromFile(bundlesTxt, home);
0199501
+			List<org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo> ibundleList = SimpleConfiguratorUtils.readConfiguration(bundlesTxt, home.toURI());
0199501
+			List<BundleInfo> bundleList = new ArrayList<BundleInfo>();
0199501
+			for (org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo b : ibundleList) {
0199501
+				URI location = b.getLocation();
0199501
+				if (!location.isAbsolute() && b.getBaseLocation() != null)
0199501
+					location = URIUtil.makeAbsolute(location, b.getBaseLocation());
0199501
+				BundleInfo binfo = new BundleInfo(b.getSymbolicName(), b.getVersion(), location, b.getStartLevel(), b.isMarkedAsStarted());
0199501
+				bundleList.add(binfo);
0199501
+			}
0199501
+			BundleInfo[] bundles = bundleList.toArray(new BundleInfo[0]);
0199501
 			if (bundles == null || bundles.length == 0) {
0199501
 				return null;
0199501
 			}
0199501
-- 
0199501
2.5.5
0199501