Skip to content

Commit cdfca82

Browse files
brooniemasahir0y
authored andcommitted
merge_config.sh: Check error codes from make
When we execute make after merging the configurations we ignore any errors it produces causing whatever is running merge_config.sh to be unaware of any failures. This issue was noticed by Guillaume Tucker while looking at problems with testing of clang only builds in KernelCI which caused Kbuild to be unable to find a working host compiler. This implementation was suggested by Yamada-san. Suggested-by: Masahiro Yamada <[email protected]> Reported-by: Guillaume Tucker <[email protected]> Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent eb27ea5 commit cdfca82

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/kconfig/merge_config.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
# Copyright (c) 2009-2010 Wind River Systems, Inc.
1414
# Copyright 2011 Linaro
1515

16+
set -e
17+
1618
clean_up() {
1719
rm -f $TMP_FILE
1820
rm -f $MERGE_FILE
19-
exit
2021
}
21-
trap clean_up HUP INT TERM
2222

2323
usage() {
2424
echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
@@ -110,6 +110,9 @@ TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
110110
MERGE_FILE=$(mktemp ./.merge_tmp.config.XXXXXXXXXX)
111111

112112
echo "Using $INITFILE as base"
113+
114+
trap clean_up EXIT
115+
113116
cat $INITFILE > $TMP_FILE
114117

115118
# Merge files, printing warnings on overridden values
@@ -155,7 +158,6 @@ if [ "$RUNMAKE" = "false" ]; then
155158
echo "#"
156159
echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
157160
echo "#"
158-
clean_up
159161
exit
160162
fi
161163

@@ -185,5 +187,3 @@ for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do
185187
echo ""
186188
fi
187189
done
188-
189-
clean_up

0 commit comments

Comments
 (0)