Support reading BundleInfo from p2 Droplets enabled installations.

This commit is contained in:
Roland Grunberg 2016-04-07 10:36:45 -04:00
parent 3cd2ce87f5
commit 0199501365
2 changed files with 65 additions and 1 deletions

View File

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

View File

@ -49,7 +49,7 @@ Epoch: 1
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_version}
Release: 8%{?dist}
Release: 9%{?dist}
License: EPL
URL: http://www.eclipse.org/
@ -151,6 +151,8 @@ Patch37: eclipse-bug-488226.patch
Patch38: eclipse-bug-489953.patch
Patch39: eclipse-bug-486069.patch
Patch40: %{pkg_name}-pde-tp-support-droplets.patch
BuildRequires: rsync
BuildRequires: make, gcc
BuildRequires: pkgconfig(glib-2.0)
@ -410,6 +412,8 @@ pushd eclipse.platform.swt
%patch39 -p1
popd
%patch40
# Resolving the target platform requires too many changes, so don't use it
%pom_xpath_remove "pom:configuration/pom:target" eclipse-platform-parent
@ -1139,6 +1143,9 @@ fi
%{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_*
%changelog
* Thu Apr 07 2016 Roland Grunberg <rgrunber@redhat.com> - 1:4.5.2-9
- Support reading BundleInfo from p2 Droplets enabled installations.
* Tue Mar 29 2016 Mat Booth <mat.booth@redhat.com> - 1:4.5.2-8
- Backport patch for ebz#486069, NPE in SWT when running on Wayland
- Eliminate more test failures due to missing resources