Skip to content

Commit bbeb83d

Browse files
committed
Merge tag 'kbuild-fixes-7.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux
Pull Kbuild fixes from Nathan Chancellor: "This mostly addresses some issues with the awk conversion in scripts/kconfig/merge_config.sh. - Fix typo to ensure .builtin-dtbs.S is properly cleaned - Fix '==' bashism in scripts/kconfig/merge_config.sh - Fix awk error in scripts/kconfig/merge_config.sh when base configuration is empty - Fix inconsistent indentation in scripts/kconfig/merge_config.sh" * tag 'kbuild-fixes-7.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux: scripts: kconfig: merge_config.sh: fix indentation scripts: kconfig: merge_config.sh: pass output file as awk variable scripts: kconfig: merge_config.sh: fix unexpected operator warning kbuild: Delete .builtin-dtbs.S when running make clean
2 parents 24f9515 + 775af5c commit bbeb83d

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ CLEAN_FILES += vmlinux.symvers modules-only.symvers \
16541654
modules.builtin.ranges vmlinux.o.map vmlinux.unstripped \
16551655
compile_commands.json rust/test \
16561656
rust-project.json .vmlinux.objs .vmlinux.export.c \
1657-
.builtin-dtbs-list .builtin-dtb.S
1657+
.builtin-dtbs-list .builtin-dtbs.S
16581658

16591659
# Directories & files removed with 'make mrproper'
16601660
MRPROPER_FILES += include/config include/generated \

scripts/kconfig/merge_config.sh

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do
151151
if ! "$AWK" -v prefix="$CONFIG_PREFIX" \
152152
-v warnoverride="$WARNOVERRIDE" \
153153
-v strict="$STRICT" \
154+
-v outfile="$TMP_FILE.new" \
154155
-v builtin="$BUILTIN" \
155156
-v warnredun="$WARNREDUN" '
156157
BEGIN {
@@ -195,7 +196,7 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do
195196
196197
# First pass: read merge file, store all lines and index
197198
FILENAME == ARGV[1] {
198-
mergefile = FILENAME
199+
mergefile = FILENAME
199200
merge_lines[FNR] = $0
200201
merge_total = FNR
201202
cfg = get_cfg($0)
@@ -212,17 +213,17 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do
212213
213214
# Not a config or not in merge file - keep it
214215
if (cfg == "" || !(cfg in merge_cfg)) {
215-
print $0 >> ARGV[3]
216+
print $0 >> outfile
216217
next
217218
}
218219
219-
prev_val = $0
220+
prev_val = $0
220221
new_val = merge_cfg[cfg]
221222
222223
# BUILTIN: do not demote y to m
223224
if (builtin == "true" && new_val ~ /=m$/ && prev_val ~ /=y$/) {
224225
warn_builtin(cfg, prev_val, new_val)
225-
print $0 >> ARGV[3]
226+
print $0 >> outfile
226227
skip_merge[merge_cfg_line[cfg]] = 1
227228
next
228229
}
@@ -235,7 +236,7 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do
235236
236237
# "=n" is the same as "is not set"
237238
if (prev_val ~ /=n$/ && new_val ~ / is not set$/) {
238-
print $0 >> ARGV[3]
239+
print $0 >> outfile
239240
next
240241
}
241242
@@ -246,25 +247,20 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do
246247
}
247248
}
248249
249-
# output file, skip all lines
250-
FILENAME == ARGV[3] {
251-
nextfile
252-
}
253-
254250
END {
255251
# Newline in case base file lacks trailing newline
256-
print "" >> ARGV[3]
252+
print "" >> outfile
257253
# Append merge file, skipping lines marked for builtin preservation
258254
for (i = 1; i <= merge_total; i++) {
259255
if (!(i in skip_merge)) {
260-
print merge_lines[i] >> ARGV[3]
256+
print merge_lines[i] >> outfile
261257
}
262258
}
263259
if (strict_violated) {
264260
exit 1
265261
}
266262
}' \
267-
"$ORIG_MERGE_FILE" "$TMP_FILE" "$TMP_FILE.new"; then
263+
"$ORIG_MERGE_FILE" "$TMP_FILE"; then
268264
# awk exited non-zero, strict mode was violated
269265
STRICT_MODE_VIOLATED=true
270266
fi
@@ -381,7 +377,7 @@ END {
381377
STRICT_MODE_VIOLATED=true
382378
fi
383379

384-
if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; then
380+
if [ "$STRICT" = "true" ] && [ "$STRICT_MODE_VIOLATED" = "true" ]; then
385381
echo "Requested and effective config differ"
386382
exit 1
387383
fi

0 commit comments

Comments
 (0)