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

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