[libvirt] [PATCH v3 2/2] maint: prohibit empty first lines

Roman Bogorodskiy bogorodskiy at gmail.com
Tue Jun 10 18:18:32 UTC 2014


  Martin Kletzander wrote:

> Based on discussion with Eric:
> 
> https://www.redhat.com/archives/libvir-list/2014-March/msg01001.html
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
> 
> Notes:
>     I've kept the first output (list of files) to stdout to sope with the
>     rest of grep checks, but I have no problem changing it to stderr
>     instead.
> 
>  cfg.mk | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/cfg.mk b/cfg.mk
> index b5f1fa2..10ad744 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -936,6 +936,13 @@ sc_require_locale_h:
>  	halt='setlocale() requires <locale.h>'				\
>  	  $(_sc_search_regexp)
> 
> +sc_prohibit_empty_first_line:
> +	@awk 'BEGIN { fail=0; }						\
> +	FNR == 1 { if ($$0 == "") { print FILENAME ":1:"; fail=1; } }	\
> +	END { if (fail == 1) {						\
> +	  print "$(ME): Prohibited empty first line" > "/dev/stderr";	\
> +	} exit fail; }' $$($(VC_LIST_EXCEPT));
> +
>  # We don't use this feature of maint.mk.
>  prev_version_file = /dev/null
> 
> @@ -1115,3 +1122,6 @@ exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = \
> 
>  exclude_file_name_regexp--sc_prohibit_mixed_case_abbreviations = \
>    ^src/(vbox/vbox_CAPI.*.h|esx/esx_vi.(c|h)|esx/esx_storage_backend_iscsi.c)$$
> +
> +exclude_file_name_regexp--sc_prohibit_empty_first_line = \
> +  ^(README|daemon/THREADS\.txt|src/esx/README|docs/library.xen|tests/vmwareverdata/fusion-5.0.3.txt)$$

It started to fail for me with this change:

prohibit_empty_first_line
tools/libvirt_win_icon_16x16.ico:1:
tools/libvirt_win_icon_32x32.ico:1:
tools/libvirt_win_icon_48x48.ico:1:
tools/libvirt_win_icon_64x64.ico:1:
maint.mk: Prohibited empty first line

I was able to fix it with:

diff --git a/cfg.mk b/cfg.mk
index 10ad744..3a3969c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1124,4 +1124,4 @@ exclude_file_name_regexp--sc_prohibit_mixed_case_abbreviations = \
   ^src/(vbox/vbox_CAPI.*.h|esx/esx_vi.(c|h)|esx/esx_storage_backend_iscsi.c)$$
 
 exclude_file_name_regexp--sc_prohibit_empty_first_line = \
-  ^(README|daemon/THREADS\.txt|src/esx/README|docs/library.xen|tests/vmwareverdata/fusion-5.0.3.txt)$$
+  ^(README|daemon/THREADS\.txt|src/esx/README|docs/library.xen|tests/vmwareverdata/fusion-5.0.3.txt|tools/.*\.ico)$$


Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140610/1e691cda/attachment-0001.sig>


More information about the libvir-list mailing list