Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core:legacy_update_mode config to opt-in for old Conan 1 update behavior #17585

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conan/internal/model/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"core:default_profile": "Defines the default host profile ('default' by default)",
"core:default_build_profile": "Defines the default build profile ('default' by default)",
"core:allow_uppercase_pkg_names": "Temporarily (will be removed in 2.X) allow uppercase names",
"core:legacy_update_mode": "Use the Conan 1 update mode, where recipe revisions are resolved in the order of the remotes",
"core.version_ranges:resolve_prereleases": "Whether version ranges can resolve to pre-releases or not",
"core.upload:retry": "Number of retries in case of failure when uploading to Conan server",
"core.upload:retry_wait": "Seconds to wait between upload attempts to Conan server",
Expand Down
3 changes: 2 additions & 1 deletion conans/client/graph/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, conan_app, editable_packages):
self._cache = conan_app.cache
self._remote_manager = conan_app.remote_manager
self._resolved = {} # Cache of the requested recipes to optimize calls
self._legacy_update = conan_app.global_conf.get("core:legacy_update_mode", False)

def get_recipe(self, ref, remotes, update, check_update):
"""
Expand Down Expand Up @@ -108,7 +109,7 @@ def _find_newest_recipe_in_remotes(self, reference, remotes, update, check_updat
ref = self._remote_manager.get_latest_recipe_reference(reference, remote)
else:
ref = self._remote_manager.get_recipe_revision_reference(reference, remote)
if not should_update_reference(reference, update) and not check_update:
if self._legacy_update or (not should_update_reference(reference, update) and not check_update):
return remote, ref
results.append({'remote': remote, 'ref': ref})
except NotFoundException:
Expand Down
Loading