]> xenbits.xensource.com Git - libvirt.git/commitdiff
syntax-check: Simplify and fix unmarked_diagnostics
authorAndrea Bolognani <abologna@redhat.com>
Tue, 8 Jan 2019 14:24:36 +0000 (15:24 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 8 Jan 2019 16:19:06 +0000 (17:19 +0100)
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 <abologna@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
cfg.mk

diff --git a/cfg.mk b/cfg.mk
index cf7fd8e81ea7462b9d08d85c53b24c7fd5d623b1..d9a8a44dc437d0355363bfbd03719895713003ad 100644 (file)
--- 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; } || :