git: d2aa049c8610 - main - MOVEDlint.awk: add the ability to select a start date
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 23 Aug 2022 12:07:50 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/ports/commit/?id=d2aa049c86107a2e8995569d9c719ddc7519a9d4
commit d2aa049c86107a2e8995569d9c719ddc7519a9d4
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2022-08-23 08:55:55 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-08-23 12:07:36 +0000
MOVEDlint.awk: add the ability to select a start date
Reviewed by: tcberner
Differential Revision: https://reviews.freebsd.org/D36304
---
Tools/scripts/MOVEDlint.awk | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/Tools/scripts/MOVEDlint.awk b/Tools/scripts/MOVEDlint.awk
index 3cbec030cb5c..ac85287a0a0d 100755
--- a/Tools/scripts/MOVEDlint.awk
+++ b/Tools/scripts/MOVEDlint.awk
@@ -44,13 +44,26 @@ BEGIN {
}
}
sort = "/usr/bin/sort -n"
- lastdate="1999-12-31"
+ if (!lastdate) {
+ lastdate="1999-12-31"
+ } else if (lastdate !~ /^20[0-3][0-9]-[01][0-9]-[0-3][0-9]$/) {
+ printf "Invalid date format '%s' expecting YYYY-MM-DD\n", lastdate
+ exit(1)
+ }
}
/^(#|$)/ {
next
}
+!started && $3 < lastdate {
+ next
+}
+
+!started && $3 >= lastdate {
+ started = 1
+}
+
NF != 4 {
printf "%5d: format is from|to|date|reason, detected %d field(s) \n", NR, NF | sort
error[NR] = 1