Skip to content
Snippets Groups Projects
Unverified Commit afc2e0c0 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

build: scripts/target_config_check.sh: output all relevant errors

Don't stop after the first error, as later error messages may make the
cause of the error much clearer in some cases.
parent 8180a986
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ packages=$2 ...@@ -9,6 +9,8 @@ packages=$2
output= output=
ret=0
LEDE_CONFIG_TARGET="${LEDE_TARGET//-/_}" LEDE_CONFIG_TARGET="${LEDE_TARGET//-/_}"
...@@ -22,6 +24,17 @@ END_MAKE ...@@ -22,6 +24,17 @@ END_MAKE
} }
fail() {
local message="$1"
if [ $ret -eq 0 ]; then
ret=1
echo "Configuration failed:" >&2
fi
echo " * $message" >&2
}
check_config() { check_config() {
grep -q "$1" lede/.config grep -q "$1" lede/.config
} }
...@@ -31,8 +44,7 @@ check_package() { ...@@ -31,8 +44,7 @@ check_package() {
local value="$2" local value="$2"
if ! check_config "^CONFIG_PACKAGE_${package}=${value}"; then if ! check_config "^CONFIG_PACKAGE_${package}=${value}"; then
echo "Configuration failed: unable to enable package '${package}'" >&2 fail "unable to enable package '${package}'"
exit 1
fi fi
} }
...@@ -43,8 +55,7 @@ config() { ...@@ -43,8 +55,7 @@ config() {
local config="$1" local config="$1"
if ! check_config "^${config}\$"; then if ! check_config "^${config}\$"; then
echo "Configuration failed: unable to set '${config}'" >&2 fail "unable to set '${config}'"
exit 1
fi fi
} }
...@@ -58,8 +69,7 @@ device() { ...@@ -58,8 +69,7 @@ device() {
fi fi
if ! check_config "CONFIG_TARGET_DEVICE_${LEDE_CONFIG_TARGET}_DEVICE_${profile}=y"; then if ! check_config "CONFIG_TARGET_DEVICE_${LEDE_CONFIG_TARGET}_DEVICE_${profile}=y"; then
echo "Configuration failed: unable to enable device '${profile}'" >&2 fail "unable to enable device '${profile}'"
exit 1
fi fi
for package in $(site_packages "$output"); do for package in $(site_packages "$output"); do
...@@ -99,3 +109,5 @@ check_devices ...@@ -99,3 +109,5 @@ check_devices
for package in $packages; do for package in $packages; do
check_package "$package" 'y' check_package "$package" 'y'
done done
exit $ret
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment