[libvirt] [PATCH] maint: avoid false positives on unmarked diagnostics

Otherwise, a string such as _("Don't use \"" VAR "\".") would complain about unmarked diagnostics. * cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message. --- I needed this patch to let me verify Stefan's DHCP Snooping series. cfg.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cfg.mk b/cfg.mk index fb4df2f..9935820 100644 --- a/cfg.mk +++ b/cfg.mk @@ -603,7 +603,7 @@ sc_libvirt_unmarked_diagnostics: $(_sc_search_regexp) @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ - | sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \ + | sed 's/_("\([^"]\|\\"\+\)*"//;s/[ ]"%s"//' \ | grep '[ ]"' && \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || : -- 1.7.7.6

On 04/30/2012 05:57 PM, Eric Blake wrote:
Otherwise, a string such as _("Don't use \"" VAR "\".") would complain about unmarked diagnostics.
* cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message. ---
I needed this patch to let me verify Stefan's DHCP Snooping series.
cfg.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg.mk b/cfg.mk index fb4df2f..9935820 100644 --- a/cfg.mk +++ b/cfg.mk @@ -603,7 +603,7 @@ sc_libvirt_unmarked_diagnostics: $(_sc_search_regexp) @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ - | sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \ + | sed 's/_("\([^"]\|\\"\+\)*"//;s/[ ]"%s"//' \ | grep '[ ]"'&& \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || :
ACK

On 05/01/2012 05:34 AM, Stefan Berger wrote:
On 04/30/2012 05:57 PM, Eric Blake wrote:
Otherwise, a string such as _("Don't use \"" VAR "\".") would complain about unmarked diagnostics.
* cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message. ---
I needed this patch to let me verify Stefan's DHCP Snooping series.
cfg.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg.mk b/cfg.mk index fb4df2f..9935820 100644 --- a/cfg.mk +++ b/cfg.mk @@ -603,7 +603,7 @@ sc_libvirt_unmarked_diagnostics: $(_sc_search_regexp) @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ - | sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \ + | sed 's/_("\([^"]\|\\"\+\)*"//;s/[ ]"%s"//' \
Shoot, I messed that up. The \+ is in the wrong place.
| grep '[ ]"'&& \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || :
Also, I suppose this misses the pathological case of "...\\", but who ends a translated message on a backslash? V2 coming up. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Otherwise, a string such as _("Don't use \"" VAR "\".") would complain about unmarked diagnostics. * cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message. --- v2: fix regex to skip all \ escape sequences, and put \+ in right place. cfg.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cfg.mk b/cfg.mk index fb4df2f..9dab3c3 100644 --- a/cfg.mk +++ b/cfg.mk @@ -603,7 +603,7 @@ sc_libvirt_unmarked_diagnostics: $(_sc_search_regexp) @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ - | sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \ + | sed 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \ | grep '[ ]"' && \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || : -- 1.7.7.6

On 05/01/2012 10:44 AM, Eric Blake wrote:
Otherwise, a string such as _("Don't use \"" VAR "\".") would complain about unmarked diagnostics.
* cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message. ---
v2: fix regex to skip all \ escape sequences, and put \+ in right place.
cfg.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg.mk b/cfg.mk index fb4df2f..9dab3c3 100644 --- a/cfg.mk +++ b/cfg.mk @@ -603,7 +603,7 @@ sc_libvirt_unmarked_diagnostics: $(_sc_search_regexp) @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ - | sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \ + | sed 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \ | grep '[ ]"'&& \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || :
ACK

On 05/01/2012 08:46 AM, Stefan Berger wrote:
On 05/01/2012 10:44 AM, Eric Blake wrote:
Otherwise, a string such as _("Don't use \"" VAR "\".") would complain about unmarked diagnostics.
* cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message. ---
v2: fix regex to skip all \ escape sequences, and put \+ in right place.
cfg.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg.mk b/cfg.mk index fb4df2f..9dab3c3 100644 --- a/cfg.mk +++ b/cfg.mk @@ -603,7 +603,7 @@ sc_libvirt_unmarked_diagnostics: $(_sc_search_regexp) @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ - | sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \ + | sed 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \ | grep '[ ]"'&& \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || :
ACK
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Stefan Berger