diff options
author | Tobias Oberlies | 2013-03-12 09:46:23 +0000 |
---|---|---|
committer | Tobias Oberlies | 2013-03-12 09:46:23 +0000 |
commit | 43d03cdba58ef6cb0c94b0e5a23ddf101778c7cd (patch) | |
tree | 4e9316f0f9075f0ef954120affc966776cbc70f4 /bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse | |
parent | 82481b8cc624dcb849b30fc4bb5426db301bb59d (diff) | |
download | rt.equinox.p2-43d03cdba58ef6cb0c94b0e5a23ddf101778c7cd.tar.gz rt.equinox.p2-43d03cdba58ef6cb0c94b0e5a23ddf101778c7cd.tar.xz rt.equinox.p2-43d03cdba58ef6cb0c94b0e5a23ddf101778c7cd.zip |
391962 Create atomic repositories by defaultI20130313-2000I20130313-0800I20130312-2000
- Bug 344851 already added the possibility to set the atomic flag on
composite repositories. As follow-up of the discussion on bug 356561,
the default for newly created repositories is changed to atomic=true.
Bug: 391962
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/CompositeRepositoryApplication.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/CompositeRepositoryApplication.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/CompositeRepositoryApplication.java index 03d3a1fda..7ae1a455a 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/CompositeRepositoryApplication.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/CompositeRepositoryApplication.java @@ -122,8 +122,6 @@ public class CompositeRepositoryApplication extends AbstractApplication { //No existing repository; create a new repository at destinationLocation but with source's attributes. IArtifactRepository repo = mgr.createRepository(toInit.getRepoLocation(), toInit.getName() != null ? toInit.getName() : (source != null ? source.getName() : Messages.CompositeRepository_default_artifactRepo_name), IArtifactRepositoryManager.TYPE_COMPOSITE_REPOSITORY, source != null ? source.getProperties() : null); initRepository(repo, toInit); - if (toInit.getAtomic() != null) - repo.setProperty(CompositeMetadataRepository.PROP_ATOMIC_LOADING, Boolean.toString(Boolean.valueOf(toInit.getAtomic()))); return repo; } catch (IllegalStateException e) { mgr.removeRepository(toInit.getRepoLocation()); @@ -162,8 +160,6 @@ public class CompositeRepositoryApplication extends AbstractApplication { //No existing repository; create a new repository at destinationLocation but with source's attributes. IMetadataRepository repo = mgr.createRepository(toInit.getRepoLocation(), toInit.getName() != null ? toInit.getName() : (source != null ? source.getName() : Messages.CompositeRepository_default_metadataRepo_name), IMetadataRepositoryManager.TYPE_COMPOSITE_REPOSITORY, source != null ? source.getProperties() : null); initRepository(repo, toInit); - if (toInit.getAtomic() != null) - repo.setProperty(CompositeMetadataRepository.PROP_ATOMIC_LOADING, Boolean.toString(Boolean.valueOf(toInit.getAtomic()))); return repo; } catch (IllegalStateException e) { mgr.removeRepository(toInit.getRepoLocation()); @@ -194,6 +190,16 @@ public class CompositeRepositoryApplication extends AbstractApplication { RepositoryHelper.validDestinationRepository(repository); if (desc.isCompressed() && !repository.getProperties().containsKey(IRepository.PROP_COMPRESSED)) repository.setProperty(IRepository.PROP_COMPRESSED, String.valueOf(true)); + + setAtomicLoadingProperty(repository, desc); + } + + private void setAtomicLoadingProperty(IRepository<?> repository, RepositoryDescriptor desc) { + // bug 356561: newly created repositories shall be atomic (by default) + boolean atomic = true; + if (desc.getAtomic() != null) + atomic = Boolean.valueOf(desc.getAtomic()); + repository.setProperty(CompositeMetadataRepository.PROP_ATOMIC_LOADING, Boolean.toString(atomic)); } public void setComparator(String value) { |