forked from Mirror/pmbootstrap
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: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
2ce06e9791
commit
01b53b0b49
1 changed files with 8 additions and 0 deletions
|
@ -672,8 +672,16 @@ def frontend(args: PmbArgs):
|
||||||
|
|
||||||
# Work folder (needs to be first, so we can create chroots early)
|
# Work folder (needs to be first, so we can create chroots early)
|
||||||
config = pmb.config.load(args.config)
|
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)
|
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)
|
# Update args and save config (so chroots and 'pmbootstrap log' work)
|
||||||
# pmb.helpers.args.update_work(args, config.work)
|
# pmb.helpers.args.update_work(args, config.work)
|
||||||
pmb.config.save(args.config, config)
|
pmb.config.save(args.config, config)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue