Skip to content
Snippets Groups Projects
Unverified Commit 01b53b0b authored by Casey's avatar Casey :recycle:
Browse files

config: init: set aports when non-default work dir is picked (MR 2366)


If you init and set a custom work dir it will not be relative to
pmaports anymore. Detect this and reset config.aports to be relative to
the new workdir.

Fixes #2406

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent 2ce06e97
Branches
Tags
1 merge request!2366More minor fixes
......@@ -672,8 +672,16 @@ def frontend(args: PmbArgs):
# Work folder (needs to be first, so we can create chroots early)
config = pmb.config.load(args.config)
# Update context to point to new config
get_context().config = config
config.work, work_exists = ask_for_work_path(args)
# If the work dir is not the default, reset aports and make
# it relative to the work dir
if not config.aports[0].is_relative_to(config.work):
config.aports = [config.work / "cache_git/pmaports"]
# Update args and save config (so chroots and 'pmbootstrap log' work)
# pmb.helpers.args.update_work(args, config.work)
pmb.config.save(args.config, config)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment