pmb.helpers.frontend.config: add support for clearing a config value (!1907)

Previously these two commands would both print the current value:
  pmbootstrap config extra_packages
  pmbootstrap config extra_packages ''

With this change, the second command will instead set the given config
value to the empty string.
This commit is contained in:
Niklas Cathor 2020-04-06 10:22:29 +02:00 committed by Alexey Min
parent 098eb4710e
commit 00a4eaf91d
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED

View file

@ -140,7 +140,7 @@ def config(args):
raise RuntimeError("Invalid config key: " + args.name)
cfg = pmb.config.load(args)
if args.value:
if args.value is not None:
cfg["pmbootstrap"][args.name] = args.value
logging.info("Config changed: " + args.name + "='" + args.value + "'")
pmb.config.save(args, cfg)