aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2017-10-30 13:56:49 +0000
committerMathieu Arnold <mat@FreeBSD.org>2017-10-30 13:56:49 +0000
commit48fc012063815228a65ce48f60da3ce813898ada (patch)
treec14e6486327601689f4b05264046910d16a15ea9 /Tools
parente0d9bfd95b8ce773b274f6f3ef65ca75416103e0 (diff)
downloadports-48fc012063815228a65ce48f60da3ce813898ada.tar.gz
ports-48fc012063815228a65ce48f60da3ce813898ada.zip
Re-enable blame (was annotate) with svn and git support.
ak@ asked that I remove the unused error array, and I went to have a look at what it was actually used for back in the day. It seemed better to re-enable the blame feature instead of removing it. Sponsored by: Absolight
Notes
Notes: svn path=/head/; revision=453175
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/MOVEDlint.awk26
1 files changed, 24 insertions, 2 deletions
diff --git a/Tools/scripts/MOVEDlint.awk b/Tools/scripts/MOVEDlint.awk
index e5f4d94110ee..1b5d94074d78 100755
--- a/Tools/scripts/MOVEDlint.awk
+++ b/Tools/scripts/MOVEDlint.awk
@@ -38,6 +38,14 @@ BEGIN {
portsdir = ENVIRON["PORTSDIR"] ? ENVIRON["PORTSDIR"] : "/usr/ports"
if (ARGC == 1) {
ARGV[ARGC++] = portsdir "/MOVED"
+ if (ENVIRON["BLAME"]) {
+ if (!system("test -d " portsdir "/.svn")) {
+ blame = "cd " portsdir "; svn blame MOVED 2>/dev/null"
+ } else if (!system("test -d " portsdir "/.git")) {
+ blame = "cd " portsdir "; git blame MOVED 2>/dev/null"
+ }
+
+ }
}
sort = "/usr/bin/sort -n"
lastdate="1999-12-31"
@@ -85,11 +93,15 @@ $3 !~ /^20[0-3][0-9]-[01][0-9]-[0-3][0-9]$/ {
}
# Produces too many false positives
-# if ($4 ~ /^[a-z].*/)
+# if ($4 ~ /^[a-z].*/) {
# printf "Initial value of 'reason' is lowercase: %5d (%s)\n", NR, $4 | sort
+# error[NR] = 1
+# }
- if ($4 ~ /\.$/)
+ if ($4 ~ /\.$/) {
printf "%5d: Final character is a dot: (%s)\n", NR, $4 | sort
+ error[NR] = 1
+ }
}
END {
@@ -103,5 +115,15 @@ END {
error[missing[port]] = 1
}
+ if (blame) {
+ line = 1
+ while (blame | getline) {
+ if (error[line])
+ printf "%5d!\n%5d! %s\n", line, line, $0 | sort
+ line++
+ }
+ close(blame)
+ }
+
close(sort)
}