From owner-svn-ports-head@freebsd.org Mon Oct 30 13:56:50 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7D1EE5D88A; Mon, 30 Oct 2017 13:56:50 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84F7E3F93; Mon, 30 Oct 2017 13:56:50 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9UDunK0087925; Mon, 30 Oct 2017 13:56:49 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9UDunsg087924; Mon, 30 Oct 2017 13:56:49 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201710301356.v9UDunsg087924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Mon, 30 Oct 2017 13:56:49 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r453175 - head/Tools/scripts X-SVN-Group: ports-head X-SVN-Commit-Author: mat X-SVN-Commit-Paths: head/Tools/scripts X-SVN-Commit-Revision: 453175 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2017 13:56:50 -0000 Author: mat Date: Mon Oct 30 13:56:49 2017 New Revision: 453175 URL: https://svnweb.freebsd.org/changeset/ports/453175 Log: 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 Modified: head/Tools/scripts/MOVEDlint.awk Modified: head/Tools/scripts/MOVEDlint.awk ============================================================================== --- head/Tools/scripts/MOVEDlint.awk Mon Oct 30 13:04:25 2017 (r453174) +++ head/Tools/scripts/MOVEDlint.awk Mon Oct 30 13:56:49 2017 (r453175) @@ -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 { @@ -101,6 +113,16 @@ END { for (port in missing) { printf "%5d: %s not found\n", missing[port], port | sort 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)