summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2022-08-05 17:12:18 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2022-08-05 17:33:16 +0200
commita79761a027803fc3fc50d47944ef86875d712b7d (patch)
tree8edbb28eadba0ff8bd5a31438a583f5dabde2d80 /scripts
parent6c7ed59f42b236321d62a454fac82d489ab59827 (diff)
downloadptxdist-a79761a027803fc3fc50d47944ef86875d712b7d.tar.gz
ptxdist-a79761a027803fc3fc50d47944ef86875d712b7d.tar.xz
ptxd_kconfig_update: remove OPTION_DOES_NOT_EXIST warning from 'conf' output
This symbol is injected to ensure that 'conf' always updates the file. 'conf' is now stricter and warns about this: warning: trying to assign nonexistent symbol OPTION_DOES_NOT_EXIST Filter out this warning as it may confuse users. Swap stdout and stdin to achive this. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/ptxd_lib_kconfig.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/lib/ptxd_lib_kconfig.sh b/scripts/lib/ptxd_lib_kconfig.sh
index 5287928c2..118deb421 100644
--- a/scripts/lib/ptxd_lib_kconfig.sh
+++ b/scripts/lib/ptxd_lib_kconfig.sh
@@ -540,6 +540,17 @@ ptxd_kconfig_sync_config() {
}
export -f ptxd_kconfig_sync_config
+ptxd_kconfig_run_conf() {
+ (
+ (
+ # swap stdout and stderr to filter out OPTION_DOES_NOT_EXIST warning
+ "${conf}" "${@}" 3>&1 1>&2 2>&3 | grep -s -v 'OPTION_DOES_NOT_EXIST'
+ # only fail if ${conf} failed
+ exit ${PIPESTATUS[0]}
+ ) 3>&1 1>&2 2>&3
+ )
+}
+export -f ptxd_kconfig_run_conf
ptxd_kconfig_update() {
local mode file_kconfig
@@ -665,7 +676,7 @@ ptxd_kconfig_update() {
"${relative_file_dotconfig}" "${file_dotconfig}" &&
if [ "${mode}" = check ]; then
- if ! "${conf}" --oldconfig "${file_kconfig}" < /dev/null; then
+ if ! ptxd_kconfig_run_conf --oldconfig "${file_kconfig}" < /dev/null; then
# error handling in ptxd_kconfig_sync_config()
:> .config
fi
@@ -683,16 +694,16 @@ ptxd_kconfig_update() {
# migrate touches the config, so update the timestamp
stat -c '%y' ".config" > ".config.stamp"
fi &&
- "${conf}" --oldconfig "${file_kconfig}"
+ ptxd_kconfig_run_conf --oldconfig "${file_kconfig}"
;;
defconfig)
ptxd_kconfig_run_conf --oldconfig "${file_kconfig}" < /dev/null > /dev/null
;;
all*config|randconfig)
- "${conf}" --${config} "${file_kconfig}"
+ ptxd_kconfig_run_conf --${config} "${file_kconfig}"
;;
dep)
- KCONFIG_ALLCONFIG=".config" "${conf}" \
+ KCONFIG_ALLCONFIG=".config" ptxd_kconfig_run_conf \
--writedepend --alldefconfig "${file_kconfig}" &&
mv -- ".config" "${PTXDIST_DGEN_DIR}/${part}config"
return