From 081d2234825e21e9dc379c7edbefd498361655ad Mon Sep 17 00:00:00 2001 From: Titouan Vervack Date: Thu, 25 Apr 2024 10:52:51 +0200 Subject: [PATCH] Make ProvisioningContext.FOLLOW_ARTIFACT_REPOSITORY_REFERENCES public to avoid duplication It was duplicated in DirectorApplication, making it hard to follow the property around the code --- .../META-INF/MANIFEST.MF | 2 +- .../internal/p2/director/app/DirectorApplication.java | 5 ++--- .../eclipse/equinox/p2/engine/ProvisioningContext.java | 10 +++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF index cfacf0e2a7..4bbd0c31cc 100644 --- a/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF @@ -22,7 +22,7 @@ Import-Package: org.bouncycastle.openpgp, org.eclipse.equinox.internal.provisional.p2.repository, org.eclipse.equinox.p2.core;version="[2.8.0,3.0.0)", org.eclipse.equinox.p2.core.spi;version="[2.1.0,3.0.0)", - org.eclipse.equinox.p2.engine;version="[2.0.0,3.0.0)", + org.eclipse.equinox.p2.engine;version="[2.2.0,3.0.0)", org.eclipse.equinox.p2.engine.query;version="[2.0.0,3.0.0)", org.eclipse.equinox.p2.metadata;version="[2.0.0,3.0.0)", org.eclipse.equinox.p2.metadata.expression;version="2.0.0", diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java index c4055a9ede..5b8ac81923 100644 --- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java +++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java @@ -431,7 +431,6 @@ private String escape(String string) { static private final String PROP_P2_PROFILE = "eclipse.p2.profile"; //$NON-NLS-1$ static private final String NO_ARTIFACT_REPOSITORIES_AVAILABLE = "noArtifactRepositoriesAvailable"; //$NON-NLS-1$ - private static final String FOLLOW_ARTIFACT_REPOSITORY_REFERENCES = "org.eclipse.equinox.p2.director.followArtifactRepositoryReferences"; //$NON-NLS-1$ private static final String LIST_GROUPS_SHORTCUT = "Q:GROUP"; //$NON-NLS-1$ private static final String QUERY_SEPARATOR = "Q:"; //$NON-NLS-1$ private static final String QUERY_SEPARATOR_SMALL = "q:"; //$NON-NLS-1$ @@ -1061,7 +1060,7 @@ private void performProvisioningActions() throws CoreException { context.setMetadataRepositories(metadataRepositoryLocations.stream().toArray(URI[]::new)); context.setArtifactRepositories(artifactRepositoryLocations.stream().toArray(URI[]::new)); context.setProperty(ProvisioningContext.FOLLOW_REPOSITORY_REFERENCES, String.valueOf(followReferences)); - context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences)); + context.setProperty(ProvisioningContext.FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences)); if (addJREIU) { context.setExtraInstallableUnits(List.of(JREAction.createJREIU())); @@ -1516,7 +1515,7 @@ private void revertToPreviousState() throws CoreException { context.setArtifactRepositories( artifactRepositoryLocations.toArray(new URI[artifactRepositoryLocations.size()])); context.setProperty(ProvisioningContext.FOLLOW_REPOSITORY_REFERENCES, String.valueOf(followReferences)); - context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences)); + context.setProperty(ProvisioningContext.FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences)); executePlan(context, plan); } diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningContext.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningContext.java index 60b212f948..edebcbe1c2 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningContext.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningContext.java @@ -107,7 +107,15 @@ public boolean contains(IArtifactRepository element) { */ public static final String CHECK_AUTHORITIES = "org.eclipse.equinox.p2.director.checkAuthorities"; //$NON-NLS-1$ - private static final String FOLLOW_ARTIFACT_REPOSITORY_REFERENCES = "org.eclipse.equinox.p2.director.followArtifactRepositoryReferences"; //$NON-NLS-1$ + /** + * Instructs the {@link PhaseSetFactory#PHASE_COLLECT collect phase} to check + * the originating sources of all installable units and artifacts. + * + * @see #getInstallableUnitSources(Collection, IProgressMonitor) + * @see #getArtifactSources(Collection, IProgressMonitor) + * @since 2.10 + */ + public static final String FOLLOW_ARTIFACT_REPOSITORY_REFERENCES = "org.eclipse.equinox.p2.director.followArtifactRepositoryReferences"; //$NON-NLS-1$ /** * Creates a new provisioning context that includes all available metadata and