Bump work version to zap for pmb 3.0.0 (MR 2352)

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-07-08 18:03:20 +02:00 committed by Oliver Smith
parent 8da12a98a7
commit ebef789f7c
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 17 additions and 1 deletions

View file

@ -46,7 +46,7 @@ pmaports_min_version = "7"
# Version of the work folder (as asked during 'pmbootstrap init'). Increase # Version of the work folder (as asked during 'pmbootstrap init'). Increase
# this number, whenever migration is required and provide the migration code, # this number, whenever migration is required and provide the migration code,
# see migrate_work_folder()). # see migrate_work_folder()).
work_version = 6 work_version = 7
# Minimum required version of postmarketos-ondev (pmbootstrap install --ondev). # Minimum required version of postmarketos-ondev (pmbootstrap install --ondev).
# Try to support the current versions of all channels (edge, v21.03). When # Try to support the current versions of all channels (edge, v21.03). When

View file

@ -238,6 +238,22 @@ def migrate_work_folder():
migrate_success(context.config.work, 6) migrate_success(context.config.work, 6)
current = 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 # Can't migrate, user must delete it
if current != required: if current != required:
raise RuntimeError( raise RuntimeError(