Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepasrap2012-11-13 17:14:07 -0500
committerPascal Rapicault2012-11-16 22:46:50 -0500
commit2e76918e2f52b5bbccb6362d15b9641d1b36b8f9 (patch)
tree5955c1176a571ddfbb1de6a8e919b5fd9a283855 /bundles/org.eclipse.equinox.p2.touchpoint.eclipse
parentf0c014f98919be76c6abd2a8fb8d172500774099 (diff)
downloadrt.equinox.p2-2e76918e2f52b5bbccb6362d15b9641d1b36b8f9.tar.gz
rt.equinox.p2-2e76918e2f52b5bbccb6362d15b9641d1b36b8f9.tar.xz
rt.equinox.p2-2e76918e2f52b5bbccb6362d15b9641d1b36b8f9.zip
Allow to install from a repository without copying the artifacts
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
index da9d01141..f371588e8 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
@@ -26,6 +26,7 @@ import org.eclipse.equinox.p2.core.spi.Constants;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.repository.IRepository;
+import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
@@ -143,9 +144,26 @@ public class Util {
}
}
}
+
+ getRunnableRepositories(manager, bundleRepositories);
return new AggregatedBundleRepository(agent, bundleRepositories);
}
+ private static void getRunnableRepositories(IArtifactRepositoryManager manager, List<IFileArtifactRepository> bundleRepositories) {
+ URI[] localURLs = manager.getKnownRepositories(IRepositoryManager.REPOSITORIES_LOCAL);
+ for (int i = 0; i < localURLs.length; i++) {
+ try {
+ IArtifactRepository candidate = manager.loadRepository(localURLs[i], new NullProgressMonitor());
+ if (Boolean.parseBoolean(candidate.getProperty(IArtifactRepository.PROP_RUNNABLE))) {
+ if (candidate != null && candidate instanceof IFileArtifactRepository && !bundleRepositories.contains(candidate))
+ bundleRepositories.add((IFileArtifactRepository) candidate);
+ }
+ } catch (ProvisionException e) {
+ //skip repositories that could not be read
+ }
+ }
+ }
+
private static List<String> getListProfileProperty(IProfile profile, String key) {
List<String> listProperty = new ArrayList<String>();
String dropinRepositories = profile.getProperty(key);

Back to the top