From fbecc64e44ee00136342d625be9e2676b5345335 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 2 May 2017 22:32:29 +0000 Subject: [PATCH] warn just once per file --- infrastructure/bin/update-patches | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/infrastructure/bin/update-patches b/infrastructure/bin/update-patches index a200954d65f..17ce83c69e8 100755 --- a/infrastructure/bin/update-patches +++ b/infrastructure/bin/update-patches @@ -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; } } }