Skip to content

Commit

Permalink
fix back migration of default compatibility.py (#16405)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored Jun 5, 2024
1 parent 8bdd803 commit 5b5015e
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit 5b5015e

Please sign in to comment.