From: Eric Blake Date: Wed, 4 Jun 2014 17:07:59 +0000 (-0600) Subject: maint: optimize locale.h syntax check X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d804a58a15fa79cb5a4f0aa7d98d45cb690ce637;p=libvirt.git maint: optimize locale.h syntax check Reusing the maint.mk code allows for a more efficient syntax check (fewer grep processes), and a more compact representation of what we are really checking for in commit 1919e35. * cfg.mk (sc_require_locale_h): Use maint.mk loop instead of rolling our own. Signed-off-by: Eric Blake --- diff --git a/cfg.mk b/cfg.mk index 675af21fca..4601b3533d 100644 --- a/cfg.mk +++ b/cfg.mk @@ -931,12 +931,10 @@ sc_prohibit_mixed_case_abbreviations: # Require #include in all files that call setlocale() sc_require_locale_h: - @for i in $$($(VC_LIST_EXCEPT) | grep '\.[chx]$$'); do \ - if ! grep -q setlocale\( $$i ; then continue; fi ; \ - if ! grep -q '# *include ' $$i ; then \ - echo '$(ME): missing locale.h include in' $$i 1>&2; exit 1; \ - fi; \ - done; + @require='include.*locale\.h' \ + containing='setlocale *(' \ + halt='setlocale() requires ' \ + $(_sc_search_regexp) # We don't use this feature of maint.mk. prev_version_file = /dev/null