diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index a999f781..62499edc 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -46,7 +46,7 @@ pmaports_min_version = "7" # Version of the work folder (as asked during 'pmbootstrap init'). Increase # this number, whenever migration is required and provide the migration code, # see migrate_work_folder()). -work_version = 6 +work_version = 7 # Minimum required version of postmarketos-ondev (pmbootstrap install --ondev). # Try to support the current versions of all channels (edge, v21.03). When diff --git a/pmb/helpers/other.py b/pmb/helpers/other.py index acb76397..a4642fa5 100644 --- a/pmb/helpers/other.py +++ b/pmb/helpers/other.py @@ -238,6 +238,22 @@ def migrate_work_folder(): migrate_success(context.config.work, 6) current = 6 + if current == 6: + # Ask for confirmation + logging.info("Changelog:") + logging.info("* Major refactor for pmb 3.0.0") + logging.info("Migration will do the following:") + logging.info("* Zap your chroots") + if not pmb.helpers.cli.confirm(): + raise RuntimeError("Aborted.") + + # Zap chroots + pmb.chroot.zap(False) + + # Update version file + migrate_success(context.config.work, 7) + current = 7 + # Can't migrate, user must delete it if current != required: raise RuntimeError(