diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2022-08-23 08:55:55 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2022-08-23 12:07:36 +0000 |
commit | d2aa049c86107a2e8995569d9c719ddc7519a9d4 (patch) | |
tree | f5682f833247014de0358b5a80b73b82605974b9 /Tools | |
parent | c297c0722c8e8a4fe231ae2774f7244f9d02431c (diff) |
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/MOVEDlint.awk | 15 |
1 files changed, 14 insertions, 1 deletions
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 |