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

fix back migration of default compatibility.py #16405

Merged
merged 1 commit into from
Jun 5, 2024
Merged
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
16 changes: 16 additions & 0 deletions conans/client/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ def _apply_migrations(self, old_version):
if old_version and old_version < "2.0.14-":
_migrate_pkg_db_lru(self.cache_folder, old_version)

if old_version and old_version < "2.4":
_migrate_default_compatibility(self.cache_folder)


def _migrate_default_compatibility(cache_folder):
# just the back migration
undo = textwrap.dedent("""\
import os

def migrate(home_folder):
from conans.client.graph.compatibility import migrate_compatibility_files
migrate_compatibility_files(home_folder)
""")
path = os.path.join(cache_folder, "migrations", "2.4_1-migrate.py")
save(path, undo)


def _migrate_pkg_db_lru(cache_folder, old_version):
config = ConfigAPI.load_config(cache_folder)
Expand Down