forked from Mirror/pmbootstrap
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:
parent
5c1c126647
commit
278dfced61
13 changed files with 90 additions and 25 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue