Replace pmaports channels stable, stable-next (MR 2032)

Translate the pmaports channels "stable" to "v20.05" and "stable-next"
to "v21.03", so these have the same channel name as the pmaports.git
branch name.

The original plan was to switch the "stable" channel from the "v20.05"
branch to the "v21.03" branch when the release is done. However, now
that we are close to that, I'm realizing that this would not be useful.
It would lead to conflicts in the dir with locally built packages
(default: ~/.local/var/pmbootstrap/packages/$CHANNEL). And it would make
it awkward to go back to a previous branch (we may name it old-stable
for the time being, but what after that, old-old-stable?).
This commit is contained in:
Oliver Smith 2021-03-02 19:47:58 +01:00
parent 5c1c126647
commit 278dfced61
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
13 changed files with 90 additions and 25 deletions

View file

@ -199,6 +199,34 @@ def migrate_work_folder(args):
migrate_success(args, 5)
current = 5
if current == 5:
# Ask for confirmation
logging.info("Changelog:")
logging.info("* besides edge, pmaports channels have the same name")
logging.info(" as the branch now (pmbootstrap#2015)")
logging.info("Migration will do the following:")
logging.info("* Zap your chroots")
logging.info("* Adjust subdirs of your locally built packages dir:")
logging.info(f" {args.work}/packages")
logging.info(" stable => v20.05")
logging.info(" stable-next => v21.03")
if not pmb.helpers.cli.confirm(args):
raise RuntimeError("Aborted.")
# Zap chroots to avoid potential "ERROR: Chroot 'native' was created
# for the 'stable' channel, but you are on the 'v20.05' channel now."
pmb.chroot.zap(args, False)
# Migrate
packages_dir = f"{args.work}/packages"
for old, new in pmb.config.pmaports_channels_legacy.items():
if os.path.exists(f"{packages_dir}/{old}"):
pmb.helpers.run.root(args, ["mv", old, new], packages_dir)
# Update version file
migrate_success(args, 6)
current = 6
# Can't migrate, user must delete it
if current != required:
raise RuntimeError("Sorry, we can't migrate that automatically. Please"