support/test-pkg: simplify the config check

Use comm(1) to check that all our config options are properly set in the
resulting configuration, rather than our canned and fragile code.

Reported-by: Cam Hutchison <camh@xdna.net>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
Yann E. MORIN 2017-02-12 15:53:07 +01:00 committed by Thomas Petazzoni
parent 55bbbe04c3
commit aeabb58dc5

View File

@ -73,7 +73,7 @@ build_one() {
local url="${2}" local url="${2}"
local cfg="${3}" local cfg="${3}"
local pkg="${4}" local pkg="${4}"
local toolchain line skip local toolchain
# Using basename(1) on a URL works nicely # Using basename(1) on a URL works nicely
toolchain="$(basename "${url}" .config)" toolchain="$(basename "${url}" .config)"
@ -106,14 +106,10 @@ build_one() {
# or not set) in the actual .config; if one of them is not, it means # or not set) in the actual .config; if one of them is not, it means
# some dependency from the toolchain or arch is not available, in # some dependency from the toolchain or arch is not available, in
# which case this config is untestable and we skip it. # which case this config is untestable and we skip it.
skip=false # We don't care about the locale to sort in, as long as both sort are
while read line; do # done in the same locale.
if ! grep "^${line}\$" "${dir}/.config" >/dev/null 2>&1; then comm -23 <(sort "${cfg}") <(sort "${dir}/.config") >"${dir}/missing.config"
printf "%s\n" "${line}" if [ -s "${dir}/missing.config" ]; then
skip=true
fi
done <"${cfg}" >"${dir}/missing.config"
if ${skip}; then
printf ", SKIPPED\n" printf ", SKIPPED\n"
return return
fi fi