git: ce9d05567d60 - main - ports-mgmt/portlint: Update to 2.20.0

From: Joe Marcus Clarke <marcus_at_FreeBSD.org>
Date: Tue, 29 Nov 2022 13:52:44 UTC
The branch main has been updated by marcus:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ce9d05567d60574b86558af0431f68b682960203

commit ce9d05567d60574b86558af0431f68b682960203
Author:     Joe Marcus Clarke <marcus@FreeBSD.org>
AuthorDate: 2022-11-29 13:50:03 +0000
Commit:     Joe Marcus Clarke <marcus@FreeBSD.org>
CommitDate: 2022-11-29 13:50:03 +0000

    ports-mgmt/portlint: Update to 2.20.0
    
    * Check for duplicate distinfo items [1]
    * Remove vestiges of SVN [2]
    
    [2] Switch to using `git status` to determine if a file is under git version
    control.  Also, PL_SVN_IGNORE has been renamed to PL_GIT_IGNORE.
    
    PR:             267168 [1]
                    267145 [2]
    Submitted by:   rodrigo [1]
    Thanks to:      pauamma for the `git status` command [2]
---
 ports-mgmt/portlint/Makefile        |  2 +-
 ports-mgmt/portlint/src/portlint.1  |  7 ++++---
 ports-mgmt/portlint/src/portlint.pl | 32 ++++++++++++++------------------
 3 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile
index c59b29f5d535..9773520ccc1a 100644
--- a/ports-mgmt/portlint/Makefile
+++ b/ports-mgmt/portlint/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	portlint
-PORTVERSION=	2.19.14
+PORTVERSION=	2.20.0
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none
diff --git a/ports-mgmt/portlint/src/portlint.1 b/ports-mgmt/portlint/src/portlint.1
index e19cf0df1848..5d97ade83bae 100644
--- a/ports-mgmt/portlint/src/portlint.1
+++ b/ports-mgmt/portlint/src/portlint.1
@@ -1,3 +1,4 @@
+.\"  $MCom$
 .\"
 .\" Copyright (c) 1997 by Jun-ichiro Hagino <itojun@itojun.org>.
 .\" All Rights Reserved.  Absolutely no warranty.
@@ -100,10 +101,10 @@ If omitted, check will be performed over the current directory.
 .Sh ENVIRONMENT
 The following environment variables affect the execution of
 .Nm :
-.Bl -tag -width ".Ev PL_SVN_IGNORE"
-.It Ev PL_SVN_IGNORE
+.Bl -tag -width ".Ev PL_GIT_IGNORE"
+.It Ev PL_GIT_IGNORE
 Set to a Perl-compatible regular expression, of patterns
-to ignore when checking to see if files are in the SVN
+to ignore when checking to see if files are in the git 
 repository.  For example,
 .Li '^\ed+$|^pr-patch$' .
 .It Ev PORTSDIR
diff --git a/ports-mgmt/portlint/src/portlint.pl b/ports-mgmt/portlint/src/portlint.pl
index c88184c55cc7..a9918a4e2b36 100644
--- a/ports-mgmt/portlint/src/portlint.pl
+++ b/ports-mgmt/portlint/src/portlint.pl
@@ -48,8 +48,8 @@ $portdir = '.';
 
 # version variables
 my $major = 2;
-my $minor = 19;
-my $micro = 14;
+my $minor = 20;
+my $micro = 0;
 
 # default setting - for FreeBSD
 my $portsdir = '/usr/ports';
@@ -131,7 +131,7 @@ if (defined $ENV{'PORTSDIR'}) {
 		$portsdir = $mconf_portsdir;
 	}
 }
-$ENV{'PL_SVN_IGNORE'} //= '';
+$ENV{'PL_GIT_IGNORE'} //= '';
 my $mfile_moved = "${portsdir}/MOVED";
 my $mfile_uids = "${portsdir}/UIDs";
 my $mfile_gids = "${portsdir}/GIDs";
@@ -338,12 +338,12 @@ if ($committer) {
 				    "If it still needs to be there, put a dummy comment ".
 					"to state that the file is intentionally left empty.");
 		} elsif (-d && scalar(my @x = <$_/{*,.?*}>) <= 1) {
-			&perror("FATAL", $fullname, -1, "empty directory should be removed.") unless ($fullname =~ /^\.svn/ || $fullname =~ /^\.git/);
+			&perror("FATAL", $fullname, -1, "empty directory should be removed.") unless ($fullname =~ /^\.git/);
 		} elsif (/^\./) {
 			&perror("WARN", $fullname, -1, "dotfiles are not preferred. ".
 					"If this file is a dotfile to be installed as an example, ".
 					"consider importing it as \"dot$_\".") unless
-					(-d && ($_ eq '.svn' || $_ eq '.git'));
+					(-d && $_ eq '.git');
 		} elsif (/[^-.a-zA-Z0-9_\+]/) {
 			&perror("WARN", $fullname, -1, "only use characters ".
 					"[-_.a-zA-Z0-9+] for patch or script names.");
@@ -356,27 +356,20 @@ if ($committer) {
 		} elsif (/README.html/) {
 			&perror("FATAL", $fullname, -1, "for safety, be sure to cleanup ".
 					"README.html files before committing the port.");
-		} elsif (($_ eq '.svn' || $_ eq '.git') && -d) {
+		} elsif ($_ eq '.git' && -d) {
 			&perror("FATAL", $fullname, -1, "for safety, be sure to cleanup ".
-				"Subversion files before committing the port.");
-
-			$File::Find::prune = 1;
-		} elsif ($_ eq 'CVS' && -d) {
-			if ($newport) {
-				&perror("FATAL", $fullname, -1, "for safety, be sure to cleanup ".
-						"CVS directories before importing the new port.");
-			}
+				"git files before committing the port.");
 
 			$File::Find::prune = 1;
 		} elsif (-f) {
 			my $fullpath = $makevar{'.CURDIR'}.'/'.$fullname;
-			my $result = `type svn >/dev/null 2>&1 && svn -q status $fullpath`;
+			my $result = `type git >/dev/null 2>&1 && git status --porcelain $fullpath`;
 
 			chomp $result;
 			if (substr($result, 0, 1) eq '?') {
-				&perror("FATAL", "", -1, "$fullname not under SVN.")
-					unless (eval { /$ENV{'PL_SVN_IGNORE'}/, 1 } &&
-						/$ENV{'PL_SVN_IGNORE'}/);
+				&perror("FATAL", "", -1, "$fullname not under git.")
+					unless (eval { /$ENV{'PL_GIT_IGNORE'}/, 1 } &&
+						/$ENV{'PL_GIT_IGNORE'}/);
 			}
 		}
 	}
@@ -445,6 +438,9 @@ sub checkdistinfo {
 		}
 		if (/(\S+)\s+\((\S+)\)\s+=\s+(\S+)/) {
 			my ($tag, $path, $value) = ($1, $2, $3);
+			if ($records{$path}{$tag}) {
+				&perror("FATAL", $file, $., "duplicate file listed.");
+			}
 			$records{$path}{$tag} = $value;
 
 			if (!$algorithms{$tag} && $tag ne "SIZE") {