diff options
author | DJ Houghton | 2008-01-15 20:57:22 +0000 |
---|---|---|
committer | DJ Houghton | 2008-01-15 20:57:22 +0000 |
commit | a24f96692e086edb3b0772bdec944000baff81e7 (patch) | |
tree | 60b06ab845bb49ec876edfdc19038cb314e19860 /bundles | |
parent | a1bcc0825db36ee01fdee3048108efa718cc66ab (diff) | |
download | rt.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.java | 22 |
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 |