olddefconfig.py 761 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python3
  2. # Copyright (c) 2018-2019, Ulf Magnusson
  3. # SPDX-License-Identifier: ISC
  4. """
  5. Updates an old .config file or creates a new one, by filling in default values
  6. for all new symbols. This is the same as picking the default selection for all
  7. symbols in oldconfig, or entering the menuconfig interface and immediately
  8. saving.
  9. The default input/output filename is '.config'. A different filename can be
  10. passed in the KCONFIG_CONFIG environment variable.
  11. When overwriting a configuration file, the old version is saved to
  12. <filename>.old (e.g. .config.old).
  13. """
  14. import kconfiglib
  15. def main():
  16. kconf = kconfiglib.standard_kconfig(__doc__)
  17. print(kconf.load_config())
  18. print(kconf.write_config())
  19. if __name__ == "__main__":
  20. main()