warn just once per file

This commit is contained in:
espie 2017-05-02 22:32:29 +00:00
parent 32b7414c25
commit fbecc64e44

View File

@ -1,6 +1,6 @@
#! /usr/bin/perl
# $OpenBSD: update-patches,v 1.5 2017/05/02 21:06:41 espie Exp $
# $OpenBSD: update-patches,v 1.6 2017/05/02 22:32:29 espie Exp $
# Copyright (c) 2017
# Marc Espie. All rights reserved.
# Redistribution and use in source and binary forms, with or without
@ -340,11 +340,16 @@ for my $k (sort keys %$saved) {
if (!$p->{accounted}) {
say "*** $p->{filename} not accounted for";
}
my ($warned_newline, $warned_keyword) = (0, 0);
for my $l (@{$p->{patch}}) {
if ($l =~ m/^\\ No newline at end of file/) {
say "*** $p->{filename} misses newline at end of file";
say "*** $p->{filename} misses newline at end of file"
unless $warned_newline;
$warned_newline = 1;
} elsif ($l =~ m/$kw_re/) {
say "*** $p->{filename} contains CVS keyword";
say "*** $p->{filename} contains CVS keyword"
unless $warned_keyword;
$warned_keyword = 1;
}
}
}