support/scripts: add check-dotconfig.py
authorRomain Naour <romain.naour@gmail.com>
Mon, 27 Jul 2020 15:51:25 +0000 (17:51 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Mon, 27 Jul 2020 16:13:19 +0000 (18:13 +0200)
commit7385ccab18d037ce37a8e8cac4f71ba1ebe2e383
treef7f49cf350ca4e945c5edd136ad705017d8c4496
parenta36ec361ffa2775a0483afe8d11489a043b1c47f
support/scripts: add check-dotconfig.py

For the same reason as for 50b747f212be2c9c0f7cf10c674ed488d042715c,
we need to check if the generated configuration file (.config)
contains all symbols present in the defconfig file.

If not there is an issue with the defconfig.

This script will be used in .gitlab-ci.yml.

Inspired by is_toolchain_usable() function from genrandconfig:
https://git.busybox.net/buildroot/tree/utils/genrandconfig?h=2020.02#n164

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr:
  - strip defconfig lines when reading them
  - use a generator to read the defconfig lines
  - no need to strip() again when building the missing list
  - testing the list directly, not its len()
  - simply sys.exit(1) in the error condition
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
support/scripts/check-dotconfig.py [new file with mode: 0755]