From 454021734297acc0ec5bead12490b3b912c01802 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 11 May 2020 00:04:40 +0200 Subject: [PATCH] build: target_config_check: dedup error messages Certain error message (for example invalid package names) were emitted once for each device. --- scripts/target_config_check.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/target_config_check.lua b/scripts/target_config_check.lua index 160c32a3..373cf430 100755 --- a/scripts/target_config_check.lua +++ b/scripts/target_config_check.lua @@ -1,13 +1,16 @@ -local ret = 0 +local errors = {} local function fail(...) - if ret == 0 then - ret = 1 + if not next(errors) then io.stderr:write('Configuration failed:', '\n') end - io.stderr:write(' * ', string.format(...), '\n') + local msg = string.format(...) + if not errors[msg] then + errors[msg] = true + io.stderr:write(' * ', msg, '\n') + end end local function match_config(f) @@ -63,4 +66,6 @@ for config, v in pairs(lib.configs) do end end -os.exit(ret) +if next(errors) then + os.exit(1) +end