diff options
Diffstat (limited to 'bundles')
2 files changed, 12 insertions, 7 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) { diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java index 5cfac9125..000d325b2 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CreateCompositeArtifactRepositoryTask.java @@ -31,7 +31,7 @@ public class CreateCompositeArtifactRepositoryTask extends Task { URI location; // desired location of the composite repository String name = "Composite Artifact Repository"; - boolean atomic = false; + boolean atomic = true; // bug 356561: newly created repositories shall be atomic (by default) boolean compressed = true; boolean failOnExists = false; // should we fail if a repo already exists? Map<String, String> properties = new HashMap<String, String>(); @@ -69,8 +69,7 @@ public class CreateCompositeArtifactRepositoryTask extends Task { // set the properties if (compressed) properties.put(IRepository.PROP_COMPRESSED, Boolean.toString(true)); - if (atomic) - properties.put(CompositeArtifactRepository.PROP_ATOMIC_LOADING, Boolean.toString(true)); + properties.put(CompositeArtifactRepository.PROP_ATOMIC_LOADING, Boolean.toString(atomic)); // create the repository try { |