diff options
author | mat <mat@FreeBSD.org> | 2017-10-30 21:56:49 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2017-10-30 21:56:49 +0800 |
commit | 281c0912a6b92f2a4bcd5b195aad7fcc7dcdf2f6 (patch) | |
tree | c14e6486327601689f4b05264046910d16a15ea9 /Tools | |
parent | 9e446cc0aa816d089816b3705221b5b28330ef47 (diff) | |
download | freebsd-ports-gnome-281c0912a6b92f2a4bcd5b195aad7fcc7dcdf2f6.tar.gz freebsd-ports-gnome-281c0912a6b92f2a4bcd5b195aad7fcc7dcdf2f6.tar.zst freebsd-ports-gnome-281c0912a6b92f2a4bcd5b195aad7fcc7dcdf2f6.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
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/MOVEDlint.awk | 26 |
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) } |