diff options
author | Eike Stepper | 2014-11-08 06:26:13 +0000 |
---|---|---|
committer | Eike Stepper | 2014-11-08 06:28:01 +0000 |
commit | 91ad6c0bf10ba848475ca6fe0e7e1160de3adf4a (patch) | |
tree | 283d689593d28d18ae98eb85a134a7f0436675cf /plugins/org.eclipse.oomph.targlets.core/src/org/eclipse/oomph/targlets/internal | |
parent | 9fb28c58ee51c0c45190955326ce0ad2ffbb42a8 (diff) | |
download | org.eclipse.oomph-91ad6c0bf10ba848475ca6fe0e7e1160de3adf4a.tar.gz org.eclipse.oomph-91ad6c0bf10ba848475ca6fe0e7e1160de3adf4a.tar.xz org.eclipse.oomph-91ad6c0bf10ba848475ca6fe0e7e1160de3adf4a.zip |
[450537] P2Exception: No default bundle pool configured for org.eclipse.oomph.targlets.core
https://bugs.eclipse.org/bugs/show_bug.cgi?id=450537
Diffstat (limited to 'plugins/org.eclipse.oomph.targlets.core/src/org/eclipse/oomph/targlets/internal')
-rw-r--r-- | plugins/org.eclipse.oomph.targlets.core/src/org/eclipse/oomph/targlets/internal/core/TargletContainerDescriptorManager.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/org.eclipse.oomph.targlets.core/src/org/eclipse/oomph/targlets/internal/core/TargletContainerDescriptorManager.java b/plugins/org.eclipse.oomph.targlets.core/src/org/eclipse/oomph/targlets/internal/core/TargletContainerDescriptorManager.java index 27d145cf3..e11e068be 100644 --- a/plugins/org.eclipse.oomph.targlets.core/src/org/eclipse/oomph/targlets/internal/core/TargletContainerDescriptorManager.java +++ b/plugins/org.eclipse.oomph.targlets.core/src/org/eclipse/oomph/targlets/internal/core/TargletContainerDescriptorManager.java @@ -10,7 +10,7 @@ */ package org.eclipse.oomph.targlets.internal.core; -import org.eclipse.oomph.p2.P2Exception; +import org.eclipse.oomph.p2.core.Agent; import org.eclipse.oomph.p2.core.AgentManager; import org.eclipse.oomph.p2.core.BundlePool; import org.eclipse.oomph.p2.core.P2Util; @@ -418,7 +418,23 @@ public final class TargletContainerDescriptorManager BundlePool bundlePool = agentManager.getDefaultBundlePool(client); if (bundlePool == null) { - throw new P2Exception("No default bundle pool configured for " + client); + File agentLocation = agentManager.getDefaultAgentLocation(); + Agent agent = agentManager.getAgent(agentLocation); + if (agent == null) + { + // Create default agent if needed. + agent = agentManager.addAgent(agentLocation); + } + + for (BundlePool pool : agent.getBundlePools()) + { + // Return any pool if one exists. + return pool.getLocation(); + } + + // Create and return default pool if agent is empty. + File poolLocation = new File(agentLocation, BundlePool.DEFAULT_NAME); + bundlePool = agent.addBundlePool(poolLocation); } return bundlePool.getLocation(); |