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