From 4abd8d01cdd8b0becdb8b37e899b10586d58610f Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Tue, 8 Jan 2019 15:24:36 +0100 Subject: [PATCH] syntax-check: Simplify and fix unmarked_diagnostics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check was concerning itself with whitespace where it didn't need to, and used some confusing escaping for one of its regular expressions - which GNU sed was fine with, but FreeBSD's sed didn't like one bit. Switch to extended regular expressions (which, incidentally, were already in use in the same rule when calling grep) and remove all whitespace handling. Signed-off-by: Andrea Bolognani Reviewed-by: Eric Blake Reviewed-by: Ján Tomko --- cfg.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg.mk b/cfg.mk index cf7fd8e81e..d9a8a44dc4 100644 --- a/cfg.mk +++ b/cfg.mk @@ -643,8 +643,8 @@ sc_libvirt_unmarked_diagnostics: $(GREP) -nE '\<$(func_re) *\(.*;$$' /dev/null; \ $(VC_LIST_EXCEPT) | xargs \ $(GREP) -A1 -nE '\<$(func_re) *\(.*,$$' /dev/null; } \ - | $(SED) 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \ - | $(GREP) '[ ]"' && \ + | $(SED) -E 's/_\("([^\"]|\\.)+"//;s/"%s"//' \ + | $(GREP) '"' && \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || :