diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-09 11:43:13 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-09 11:43:13 +0100 |
| commit | 395c2db0e9761def8eb992e3e8068ba2d3ab179c (patch) | |
| tree | 7b14ac791dbf9d4b9354f1c6149444e090068309 /examples/defconfig_oldconfig.py | |
| parent | 8c978ee0b9c0f7f8406f58d24478a73330512056 (diff) | |
| parent | 4bffd653148d6fa1c8e626872ae4f445e2b0a24c (diff) | |
Make Kconfiglib 2 official
Merge in the 'kconfiglib-2-backup' branch.
Diffstat (limited to 'examples/defconfig_oldconfig.py')
| -rw-r--r-- | examples/defconfig_oldconfig.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/examples/defconfig_oldconfig.py b/examples/defconfig_oldconfig.py index 9a85440..84aa134 100644 --- a/examples/defconfig_oldconfig.py +++ b/examples/defconfig_oldconfig.py @@ -7,27 +7,31 @@ # yes n | make oldconfig # # This came up in https://github.com/ulfalizer/Kconfiglib/issues/15. +# +# Usage: +# +# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/defconfig_oldconfig.py import kconfiglib import sys -conf = kconfiglib.Config(sys.argv[1]) +kconf = kconfiglib.Kconfig(sys.argv[1]) # Mirrors defconfig -conf.load_config("arch/x86/configs/x86_64_defconfig") -conf.write_config(".config") +kconf.load_config("arch/x86/configs/x86_64_defconfig") +kconf.write_config(".config") # Mirrors the first oldconfig -conf.load_config(".config") -conf["ETHERNET"].set_user_value('n') -conf.write_config(".config") +kconf.load_config(".config") +kconf.syms["ETHERNET"].set_value(0) +kconf.write_config(".config") # Mirrors the second oldconfig -conf.load_config(".config") -conf["ETHERNET"].set_user_value('y') -for s in conf: - if s.get_user_value() is None and 'n' in s.get_assignable_values(): - s.set_user_value('n') +kconf.load_config(".config") +kconf.syms["ETHERNET"].set_value(2) +for s in kconf.defined_syms: + if s.user_value is None and 0 in s.assignable: + s.set_value(0) # Write the final configuration -conf.write_config(".config") +kconf.write_config(".config") |
