Print only missing dependencies

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2020-04-26 22:29:57 +02:00
parent c142620724
commit fc09d27a92

View File

@ -86,11 +86,17 @@ config_has () {
## depends_on SYMBOL... ## depends_on SYMBOL...
## Exit if the library configuration does not have all SYMBOLs set. ## Exit if the library configuration does not have all SYMBOLs set.
depends_on () { depends_on () {
if ! config_has "$@"; then m=
for x in "$@"; do
if ! config_has "$x"; then
m="$m $x"
fi
done
if [ -n "$m" ]; then
cat >&2 <<EOF cat >&2 <<EOF
This demo script requires the following configuration options to be enabled $0: this demo requires the following
at compile time: configuration options to be enabled at compile time:
$@ $m
EOF EOF
# Exit with a success status so that this counts as a pass for run_demos.py. # Exit with a success status so that this counts as a pass for run_demos.py.
exit exit