Makefile: allow headers to have old years

This commit is contained in:
Lucas Servén Marín 2020-01-07 15:07:34 +01:00
parent c9c2e9bc42
commit 4acdca89e5
No known key found for this signature in database
GPG Key ID: 586FEAF680DA74AD

View File

@ -185,12 +185,12 @@ unit:
test: lint unit
header: .header
@HEADER=$$(sed "s/YEAR/$$(date '+%Y')/" .header); \
@HEADER=$$(cat .header); \
HEADER_LEN=$$(wc -l .header | awk '{print $$1}'); \
FILES=; \
for f in $(GO_FILES); do \
for i in 0 1 2 3 4 5; do \
FILE=$$(tail -n +$$i $$f | head -n $$HEADER_LEN); \
FILE=$$(tail -n +$$i $$f | head -n $$HEADER_LEN | sed "s/[0-9]\{4\}/YEAR/"); \
[ "$$FILE" = "$$HEADER" ] && continue 2; \
done; \
FILES="$$FILES$$f "; \