fullconfig.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env python3
  2. # Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  3. # All rights reserved.
  4. #
  5. # This software is supplied "AS IS" without any warranties.
  6. # RDA assumes no responsibility or liability for the use of the software,
  7. # conveys no license or title under any patent, copyright, or mask work
  8. # right to the product. RDA reserves the right to make changes in the
  9. # software without notification. RDA also make no representation or
  10. # warranty that such application will be suitable for the specified use
  11. # without further testing or modification.
  12. import argparse
  13. import sys
  14. import kconfiglib
  15. DESCRIPTION = """
  16. Convert a configuration file to "full" configuration file.
  17. """
  18. def main():
  19. parser = argparse.ArgumentParser(description=DESCRIPTION)
  20. parser.add_argument(
  21. "--kconfig",
  22. metavar="KCONFIG_FILENAME",
  23. dest="kconfig",
  24. default="Kconfig",
  25. help="top-level Kconfig file (default: Kconfig)")
  26. parser.add_argument(
  27. "config",
  28. metavar="CONFIG_FILENAME",
  29. nargs='+',
  30. help="configuration file name")
  31. args = parser.parse_args()
  32. kconf = kconfiglib.Kconfig(args.kconfig)
  33. for config in args.config:
  34. kconf.load_config(config)
  35. kconf.write_config(config)
  36. if __name__ == "__main__":
  37. main()