MOVEDlint: accept -v blame=1 from command line

This commit is contained in:
Baptiste Daroussin 2022-08-23 14:43:14 +02:00
parent ad83ff7170
commit 85397ca391

View File

@ -36,11 +36,13 @@ BEGIN {
portsdir = ENVIRON["PORTSDIR"] ? ENVIRON["PORTSDIR"] : "/usr/ports"
if (ARGC == 1) {
ARGV[ARGC++] = portsdir "/MOVED"
if (ENVIRON["BLAME"]) {
if (!system("test -r " portsdir "/.git")) {
blame = "cd " portsdir "; git blame MOVED 2>/dev/null"
}
}
if (ENVIRON["BLAME"]) {
blame=1
}
if (blame) {
if (!system("test -r " portsdir "/.git")) {
blame = "cd " portsdir "; git blame MOVED 2>/dev/null"
}
}
sort = "/usr/bin/sort -n"