Blame SOURCES/eclipse-make-droplets-runnable.patch

0f5e1f
From decc6ec5f3c5ce87fa50c2cfe932d66e89496810 Mon Sep 17 00:00:00 2001
0f5e1f
From: Roland Grunberg <rgrunber@redhat.com>
0f5e1f
Date: Wed, 3 Aug 2016 14:57:10 -0400
0f5e1f
Subject: [PATCH] p2 Droplets should be recognized as runnable repositories.
0f5e1f
0f5e1f
Normally, a runnable repository is identified by the 'p2.runnable'
0f5e1f
property contained within the artifact repository (artifact.xml).
0f5e1f
However, in Fedora we ship p2 Droplets without this file so we need a
0f5e1f
way to let methods like getRunnableRepositories in
0f5e1f
o.e.equinox.internal.p2.touchpoint.eclipse.Util know that p2 Droplets
0f5e1f
are runnable repositories.
0f5e1f
0f5e1f
Change-Id: I0ad0a7557f998b4d032466f89e6cc76036d1fb38
0f5e1f
---
0f5e1f
 .../ExtensionLocationArtifactRepository.java             | 16 ++++++++++++++++
0f5e1f
 1 file changed, 16 insertions(+)
0f5e1f
0f5e1f
diff --git rt.equinox.p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java rt.equinox.p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
0f5e1f
index 342e33e..425a166 100644
0f5e1f
--- rt.equinox.p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
0f5e1f
+++ rt.equinox.p2/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
0f5e1f
@@ -284,6 +284,22 @@ public class ExtensionLocationArtifactRepository extends AbstractRepository
0f5e1f
 		return artifactRepository.getProperties();
0f5e1f
 	}
0f5e1f
 
0f5e1f
+	public String getProperty(String key) {
0f5e1f
+		if (IArtifactRepository.PROP_RUNNABLE.equals(key)) {
0f5e1f
+			String candidate = getLocation().getPath();
0f5e1f
+			String fragments = System.getProperty("p2.fragments");
0f5e1f
+			if (fragments != null) {
0f5e1f
+				String[] rootPaths = fragments.split(",");
0f5e1f
+				for (String root : rootPaths) {
0f5e1f
+					if (candidate.startsWith(root)) {
0f5e1f
+						return Boolean.TRUE.toString();
0f5e1f
+					}
0f5e1f
+				}
0f5e1f
+			}
0f5e1f
+		}
0f5e1f
+		return super.getProperty(key);
0f5e1f
+	}
0f5e1f
+
0f5e1f
 	@Override
0f5e1f
 	public String setProperty(String key, String value, IProgressMonitor monitor) {
0f5e1f
 		try {
0f5e1f
-- 
0f5e1f
2.7.4
0f5e1f