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

Eric Blake eblake at redhat.com
Tue Jun 10 19:21:49 UTC 2014


On 06/10/2014 12:18 PM, Roman Bogorodskiy wrote:

>> +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:

Hmm, it might be simpler just to globally exclude all image formats,
rather than repeating lists of image files in affected rules.

> I was able to fix it with:
> 

>  
>  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)$$

Not quite consistent with other places where we ignore image files; for
example:

exclude_file_name_regexp--sc_trailing_blank = \
  (/qemuhelpdata/|\.(fig|gif|ico|png)$$)

but my thoughts are that we should really ditch those one-off exception
lists for graphic binary files, and instead modify this list:

VC_LIST_ALWAYS_EXCLUDE_REGEX = \
  (^(HACKING|docs/(news\.html\.in|.*\.patch))|\.po)$$


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140610/d6daf19f/attachment-0001.sig>


More information about the libvir-list mailing list