mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 11:29:46 +03:00
Fix "pmbootstrap config args /new/path" (MR 2374)
Fix writing config options that are stored as CSV-list. Without this patch: $ pmbootstrap config aports /tmp/pmaports [23:43:58] Config changed: aports='/tmp/pmaports' $ pmbootstrap config aports [PosixPath('/'), PosixPath('t'), PosixPath('m'), PosixPath('p'), PosixPath('/'), PosixPath('p'), PosixPath('m'), PosixPath('a'), PosixPath('p'), PosixPath('o'), PosixPath('r'), PosixPath('t'), PosixPath('s')] Storing strings as CSV list isn't great and we probably want to implement this more elegantly, see the related issue. But let's fix this first. Related: pmbootstrap issue 2412
This commit is contained in:
parent
e746c181a7
commit
b14a872fad
1 changed files with 4 additions and 1 deletions
|
@ -242,7 +242,10 @@ def config(args: PmbArgs):
|
|||
logging.info(f"Config changed to default: {args.name}='{def_value}'")
|
||||
pmb.config.save(args.config, config)
|
||||
elif args.value is not None:
|
||||
setattr(config, args.name, args.value)
|
||||
if isinstance(getattr(Config, args.name), list):
|
||||
setattr(config, args.name, args.value.split(","))
|
||||
else:
|
||||
setattr(config, args.name, args.value)
|
||||
logging.info("Config changed: " + args.name + "='" + args.value + "'")
|
||||
pmb.config.save(args.config, config)
|
||||
elif args.name:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue