Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2008-01-15 20:57:22 +0000
committerDJ Houghton2008-01-15 20:57:22 +0000
commita24f96692e086edb3b0772bdec944000baff81e7 (patch)
tree60b06ab845bb49ec876edfdc19038cb314e19860 /bundles
parenta1bcc0825db36ee01fdee3048108efa718cc66ab (diff)
downloadrt.equinox.p2-a24f96692e086edb3b0772bdec944000baff81e7.tar.gz
rt.equinox.p2-a24f96692e086edb3b0772bdec944000baff81e7.tar.xz
rt.equinox.p2-a24f96692e086edb3b0772bdec944000baff81e7.zip
Allow the creation of a new repo.v20080115-1600
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java
index fe9e8bbc3..ff8b09026 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java
@@ -135,15 +135,19 @@ public class EclipseGeneratorApplication implements IApplication {
throw new IllegalArgumentException("Metadata repository location not a valid URL:" + artifactLocation); //$NON-NLS-1$
}
IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(Activator.context, IMetadataRepositoryManager.class.getName());
- IMetadataRepository repository = manager.loadRepository(location, null);
- if (repository != null) {
- repository.setProperty(IRepository.PROP_COMPRESSED, compress);
- if (!repository.isModifiable())
- throw new IllegalArgumentException("Metadata repository not writeable: " + location); //$NON-NLS-1$
- provider.setMetadataRepository(repository);
- if (!provider.append())
- repository.removeAll();
- return;
+ try {
+ IMetadataRepository repository = manager.loadRepository(location, null);
+ if (repository != null) {
+ repository.setProperty(IRepository.PROP_COMPRESSED, compress);
+ if (!repository.isModifiable())
+ throw new IllegalArgumentException("Metadata repository not writeable: " + location); //$NON-NLS-1$
+ provider.setMetadataRepository(repository);
+ if (!provider.append())
+ repository.removeAll();
+ return;
+ }
+ } catch (ProvisionException e) {
+ //fall through and create a new repository
}
// the given repo location is not an existing repo so we have to create something

Back to the top