[libvirt] [PATCH v2] maint: prohibit empty first lines
Eric Blake
eblake at redhat.com
Wed Jun 4 16:14:24 UTC 2014
On 06/04/2014 07:01 AM, 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>
> ---
> v2:
> - rebase on current master and s/FILENAME:1:/FILENAME ":1:"/
>
> cfg.mk | 7 +++++++
> 1 file changed, 7 insertions(+)
The existing sc_prohibit_empty_lines_at_EOF in maint.mk does a similar
check but using perl instead of awk. But that shouldn't matter.
>
> diff --git a/cfg.mk b/cfg.mk
> index 675af21..80440b5 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -938,6 +938,13 @@ sc_require_locale_h:
> fi; \
> done;
>
> +sc_prohibit_empty_first_line:
> + @awk 'BEGIN { fail=0; } \
> + FNR == 1 { if ($$0 == "") { print FILENAME ":1:"; fail=1; } } \
why is this to stdout...
> + END { if (fail == 1) { \
> + print "$(ME): Prohibited empty first line" > "/dev/stderr"; \
...but this to stderr?
> + } exit fail; }' $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$');
I'd use ALL of VC_LIST_EXCEPT (not just the .c and .h files). But in
general it looks like it does the right thing.
--
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/20140604/edf6333e/attachment-0001.sig>
More information about the libvir-list
mailing list