From nobody Mon Feb 9 00:54:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1546544536417397.62063492711854; Thu, 3 Jan 2019 11:42:16 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D095BC05B03C; Thu, 3 Jan 2019 19:42:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91F526061B; Thu, 3 Jan 2019 19:42:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 42D90181B9EB; Thu, 3 Jan 2019 19:42:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x03JgCeO027750 for ; Thu, 3 Jan 2019 14:42:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 722CF45B9; Thu, 3 Jan 2019 19:42:12 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-216.phx2.redhat.com [10.3.116.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CBDA19742; Thu, 3 Jan 2019 19:42:12 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Thu, 3 Jan 2019 13:41:59 -0600 Message-Id: <20190103194159.6177-4-eblake@redhat.com> In-Reply-To: <20190103194159.6177-1-eblake@redhat.com> References: <20190103194159.6177-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: r.bolshakov@yadro.com Subject: [libvirt] [PATCH v2 3/3] maint: split long lines for BSD syntax-check X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 03 Jan 2019 19:42:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Similar to the gnulib changes we just incorporated into maint.mk, it's time to use '$(VC_LIST) | xargs program' instead of 'program $$($(VC_LIST))', in order to bypass the problem of hitting argv limits due to our large set of files. Drop several uses of $$files as a temporary variable when we can instead directly use xargs. While at it, fix a typo in the prohibit_windows_special_chars error message. Signed-off-by: Eric Blake Reviewed-by: J=C3=A1n Tomko --- cfg.mk | 75 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/cfg.mk b/cfg.mk index 9956d20034..e2702d50c9 100644 --- a/cfg.mk +++ b/cfg.mk @@ -639,8 +639,10 @@ sc_libvirt_unmarked_diagnostics: exclude=3D'_\(' \ halt=3D'found unmarked diagnostic(s)' \ $(_sc_search_regexp) - @{ $(GREP) -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ - $(GREP) -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ + @{ $(VC_LIST_EXCEPT) | xargs \ + $(GREP) -nE '\<$(func_re) *\(.*;$$' /dev/null; \ + $(VC_LIST_EXCEPT) | xargs \ + $(GREP) -A1 -nE '\<$(func_re) *\(.*,$$' /dev/null; } \ | $(SED) 's/_("\([^\"]\|\\.\)\+"//;s/[ ]"%s"//' \ | $(GREP) '[ ]"' && \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ @@ -654,8 +656,8 @@ sc_libvirt_unmarked_diagnostics: # there are functions to which this one applies but that do not get marked # diagnostics. sc_prohibit_newline_at_end_of_diagnostic: - @$(GREP) -A2 -nE \ - '\<$(func_re) *\(' $$($(VC_LIST_EXCEPT)) \ + @$(VC_LIST_EXCEPT) | xargs $(GREP) -A2 -nE \ + '\<$(func_re) *\(' /dev/null \ | $(GREP) '\\n"' \ && { echo '$(ME): newline at end of message(s)' 1>&2; \ exit 1; } || : @@ -664,8 +666,10 @@ sc_prohibit_newline_at_end_of_diagnostic: # allow VIR_ERROR to do this, and ignore functions that take a single # string rather than a format argument. sc_prohibit_diagnostic_without_format: - @{ $(GREP) -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \ - $(GREP) -A2 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \ + @{ $(VC_LIST_EXCEPT) | xargs \ + $(GREP) -nE '\<$(func_re) *\(.*;$$' /dev/null; \ + $(VC_LIST_EXCEPT) | xargs \ + $(GREP) -A2 -nE '\<$(func_re) *\(.*,$$' /dev/null; } \ | $(SED) -rn -e ':l; /[,"]$$/ {N;b l;}' \ -e '/(xenapiSessionErrorHandler|vah_(error|warning))/d' \ -e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \ @@ -687,7 +691,7 @@ sc_prohibit_useless_translation: # When splitting a diagnostic across lines, ensure that there is a space # or \n on one side of the split. sc_require_whitespace_in_translation: - @$(GREP) -n -A1 '"$$' $$($(VC_LIST_EXCEPT)) \ + @$(VC_LIST_EXCEPT) | xargs $(GREP) -n -A1 '"$$' /dev/null \ | $(SED) -ne ':l; /"$$/ {N;b l;}; s/"\n[^"]*"/""/g; s/\\n/ /g' \ -e '/_(.*[^\ ]""[^\ ]/p' | $(GREP) . && \ { echo '$(ME): missing whitespace at line split' 1>&2; \ @@ -803,7 +807,8 @@ sc_prohibit_cross_inclusion: # When converting an enum to a string, make sure that we track any new # elements added to the enum by using a _LAST marker. sc_require_enum_last_marker: - @$(GREP) -A1 -nE '^[^#]*VIR_ENUM_IMPL *\(' $$($(VC_LIST_EXCEPT)) \ + @$(VC_LIST_EXCEPT) | xargs \ + $(GREP) -A1 -nE '^[^#]*VIR_ENUM_IMPL *\(' /dev/null \ | $(SED) -ne '/VIR_ENUM_IMPL[^,]*,$$/N' \ -e '/VIR_ENUM_IMPL[^,]*,[^,]*[^_,][^L,][^A,][^S,][^T,],/p' \ -e '/VIR_ENUM_IMPL[^,]*,[^,]\{0,4\},/p' \ @@ -866,8 +871,7 @@ sc_prohibit_atoi: $(_sc_search_regexp) sc_prohibit_wrong_filename_in_comment: - @fail=3D0; \ - awk 'BEGIN { \ + @$(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs awk 'BEGIN { \ fail=3D0; \ } FNR < 3 { \ n=3Dmatch($$0, /[[:space:]][^[:space:]]*[.][ch][[:space:]:]/); \ @@ -883,11 +887,8 @@ sc_prohibit_wrong_filename_in_comment: if (fail =3D=3D 1) { \ exit 1; \ } \ - }' $$($(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$') || fail=3D1; \ - if test $$fail -eq 1; then \ - { echo '$(ME): The file name in comments must match the' \ - 'actual file name' 1>&2; exit 1; } \ - fi; + }' || { echo '$(ME): The file name in comments must match the' \ + 'actual file name' 1>&2; exit 1; } sc_prohibit_virConnectOpen_in_virsh: @prohibit=3D'\bvirConnectOpen[a-zA-Z]* *\(' \ @@ -918,22 +919,21 @@ sc_require_if_else_matching_braces: $(_sc_search_regexp) sc_curly_braces_style: - @files=3D$$($(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$'); \ - if $(GREP) -nHP \ + @if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs $(GREP) -nHP \ '^\s*(?!([a-zA-Z_]*for_?each[a-zA-Z_]*) ?\()([_a-zA-Z0-9]+( [_a-zA-Z0-9]+)= * ?\()?(\*?[_a-zA-Z0-9]+(,? \*?[_a-zA-Z0-9\[\]]+)+|void)\) ?\{' \ - $$files; then \ + /dev/null; then \ echo '$(ME): Non-K&R style used for curly braces around' \ 'function body' 1>&2; exit 1; \ fi; \ - if $(GREP) -A1 -En ' ((if|for|while|switch) \(|(else|do)\b)[^{]*$$'\ - $$files | $(GREP) '^[^ ]*- *{'; then \ + if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs \ + $(GREP) -A1 -En ' ((if|for|while|switch) \(|(else|do)\b)[^{]*$$' \ + /dev/null | $(GREP) '^[^ ]*- *{'; then \ echo '$(ME): Use hanging braces for compound statements' 1>&2; exit 1; \ fi sc_prohibit_windows_special_chars_in_filename: - @files=3D$$($(VC_LIST_EXCEPT) | $(GREP) '[:*?"<>|]'); \ - test -n "$$files" && { echo '$(ME): Windows special chars' \ - 'in filename not allowed:' 1>&2; echo $$files 1>&2; exit 1; } || : + @$(VC_LIST_EXCEPT) | $(GREP) '[:*?"<>|]' && \ + { echo '$(ME): Windows special chars in filename not allowed' 1>&2; echo = exit 1; } || : sc_prohibit_mixed_case_abbreviations: @prohibit=3D'Pci|Usb|Scsi' \ @@ -949,11 +949,11 @@ sc_require_locale_h: $(_sc_search_regexp) sc_prohibit_empty_first_line: - @awk 'BEGIN { fail=3D0; } \ + @$(VC_LIST_EXCEPT) | xargs awk 'BEGIN { fail=3D0; } \ FNR =3D=3D 1 { if ($$0 =3D=3D "") { print FILENAME ":1:"; fail=3D1; } } \ END { if (fail =3D=3D 1) { \ print "$(ME): Prohibited empty first line" > "/dev/stderr"; \ - } exit fail; }' $$($(VC_LIST_EXCEPT)); + } exit fail; }' sc_prohibit_paren_brace: @prohibit=3D'\)\{$$' \ @@ -996,8 +996,9 @@ sc_prohibit_sysconf_pagesize: $(_sc_search_regexp) sc_prohibit_virSecurity: - @$(GREP) -Pn 'virSecurityManager(?!Ptr)' $$($(VC_LIST_EXCEPT) | $(GREP) '= src/qemu/' | \ - $(GREP) -v 'src/qemu/qemu_security') && \ + @$(VC_LIST_EXCEPT) | $(GREP) 'src/qemu/' | \ + $(GREP) -v 'src/qemu/qemu_security' | \ + xargs $(GREP) -Pn 'virSecurityManager(?!Ptr)' /dev/null && \ { echo '$(ME): prefer qemuSecurity wrappers' 1>&2; exit 1; } || : sc_prohibit_pthread_create: @@ -1128,25 +1129,25 @@ endif # Don't include duplicate header in the source (either *.c or *.h) prohibit-duplicate-header: - $(AM_V_GEN)files=3D$$($(VC_LIST_EXCEPT) | $(GREP) '\.[chx]$$'); \ - $(PERL) -W $(top_srcdir)/build-aux/prohibit-duplicate-header.pl $$files + $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[chx]$$' | xargs \ + $(PERL) -W $(top_srcdir)/build-aux/prohibit-duplicate-header.pl spacing-check: - $(AM_V_GEN)files=3D`$(VC_LIST) | $(GREP) '\.c$$'`; \ - $(PERL) $(top_srcdir)/build-aux/check-spacing.pl $$files || \ + $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.c$$' | xargs \ + $(PERL) $(top_srcdir)/build-aux/check-spacing.pl || \ { echo '$(ME): incorrect formatting' 1>&2; exit 1; } mock-noinline: - $(AM_V_GEN)files=3D`$(VC_LIST) | $(GREP) '\.[ch]$$'`; \ - $(PERL) $(top_srcdir)/build-aux/mock-noinline.pl $$files + $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[ch]$$' | xargs \ + $(PERL) $(top_srcdir)/build-aux/mock-noinline.pl header-ifdef: - $(AM_V_GEN)files=3D`$(VC_LIST) | $(GREP) '\.[h]$$'`; \ - $(PERL) $(top_srcdir)/build-aux/header-ifdef.pl $$files + $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[h]$$' | xargs \ + $(PERL) $(top_srcdir)/build-aux/header-ifdef.pl test-wrap-argv: - $(AM_V_GEN)files=3D`$(VC_LIST) | $(GREP) -E '\.(ldargs|args)'`; \ - $(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check $$files + $(AM_V_GEN)$(VC_LIST) | $(GREP) -E '\.(ldargs|args)' | xargs \ + $(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check group-qemu-caps: $(AM_V_GEN)$(PERL) $(top_srcdir)/tests/group-qemu-caps.pl --check $(top_s= rcdir)/ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list