ports-mgmt/portlint: Update to 2.19.5

* Reverse $FreeBSD$ check logic to make the use of them FATAL [1]
* Remove embedded $FreeBSD$
PR:		255153 [1]
Obtained from:	lwhsu [1]
		With issue report from Tatsuki Makino
This commit is contained in:
Joe Marcus Clarke 2021-04-19 16:49:33 -04:00
parent df20e63881
commit f36c30ba18
3 changed files with 13 additions and 40 deletions

View file

@ -1,7 +1,7 @@
# Created by: Jun-ichiro itojun Hagino <itojun@itojun.org>
PORTNAME= portlint
PORTVERSION= 2.19.4
PORTVERSION= 2.19.5
CATEGORIES= ports-mgmt
MASTER_SITES= # none
DISTFILES= # none

View file

@ -1,4 +1,4 @@
.\" $MCom: portlint/portlint.1,v 1.14 2020/05/30 13:03:55 jclarke Exp $
.\" $MCom: portlint/portlint.1,v 1.15 2021/04/19 20:48:32 jclarke Exp $
.\"
.\" Copyright (c) 1997 by Jun-ichiro Hagino <itojun@itojun.org>.
.\" All Rights Reserved. Absolutely no warranty.

View file

@ -14,7 +14,7 @@
# bsd.port.mk. There are significant differences in those so non-FreeBSD code
# was removed.
#
# $MCom: portlint/portlint.pl,v 1.522 2020/12/27 19:19:02 jclarke Exp $
# $MCom: portlint/portlint.pl,v 1.525 2021/04/19 20:48:32 jclarke Exp $
#
use strict;
@ -49,7 +49,7 @@ $portdir = '.';
# version variables
my $major = 2;
my $minor = 19;
my $micro = 4;
my $micro = 5;
# default setting - for FreeBSD
my $portsdir = '/usr/ports';
@ -138,7 +138,6 @@ my $mfile_gids = "${portsdir}/GIDs";
if ($verbose) {
print "OK: config: portsdir: \"$portsdir\" ".
"rcsidstr: \"$rcsidstr\" ".
"localbase: $localbase ".
"\n";
}
@ -588,7 +587,6 @@ sub checkdescr {
sub checkplist {
my($file) = @_;
my($curdir) = ($localbase);
my($rcsidseen) = (0);
my $seen_special = 0;
my $item_count = 0;
@ -726,7 +724,7 @@ sub checkplist {
"for more details).");
}
} elsif ($_ =~ /^\@(comment)/) {
$rcsidseen++ if (/\$$rcsidstr[:\$]/);
&perror("FATAL", $file, $., "\$$rcsidstr\$ is deprecated in Git.") if (/\$$rcsidstr[:\$]/);
} elsif ($_ =~ m!^\@(dirrm|dirrmtry)\s+/!) {
&perror("WARN", $file, $., "Using \@$1 with absolute path ".
"will not work as you expected in most cases. Use ".
@ -1443,20 +1441,19 @@ sub checkmakefile {
print "OK: checking header in $file.\n" if ($verbose);
if ($lines[1] =~ /^# (?:New )?[Pp]orts collection [mM]akefile/) {
&perror("FATAL", $file, 1, "old style headers found.");
} elsif ($lines[1] =~ /^# \$$rcsidstr[:\$]/) {
&perror("FATAL", $file, 1, "\$$rcsidstr\$ is deprecated in Git.");
} elsif ($lines[1] =~ /^# Created by: \S/) {
if ($lines[2] !~ /^# \$$rcsidstr[:\$]/) {
&perror("FATAL", $file, 2, "header should be ".
"followed by \$$rcsidstr\$.");
} elsif ($lines[3] !~ /^$/) {
#&perror("FATAL", $file, 3, "do not add extra ".
if ($lines[2] =~ /^# \$$rcsidstr[:\$]/) {
&perror("FATAL", $file, 2, "\$$rcsidstr\$ is deprecated in Git.");
}
if ($lines[2] !~ /^$/) {
#&perror("FATAL", $file, 2, "do not add extra ".
# "empty comments after header.");
}
# special case for $rcsidsrt\nMCom:
} elsif ($lines[1] =~ /^# \$$rcsidstr[:\$]/ and $lines[2] =~ /^#\s+\$MCom[:\$]/ and $lines[3] =~ /^$/) {
} elsif ($lines[1] =~ /^#\s+\$MCom[:\$]/ and $lines[2] =~ /^$/) {
# DO NOTHING
} elsif ($lines[1] !~ /^# \$$rcsidstr[:\$]/ or $lines[2] !~ /^$/) {
&perror("FATAL", $file, 1, "incorrect header; ".
"simply use \$$rcsidstr\$.");
}
#
@ -2685,30 +2682,6 @@ EOF
if ($tmp =~ m/Version [rR]equired/) {
&perror("WARN", $file, -1, "Version required is no longer needed in the comment section.");
}
my $tmp2 = "";
for (split(/\n/, $tmp)) {
$tmp2 .= $_ if (m/\$$rcsidstr/);
}
if ($tmp2 !~ /#(\s+)\$$rcsidstr([^\$]*)\$$/) {
&perror("FATAL", $file, -1, "no \$$rcsidstr\$ line in comment ".
"section.");
} else {
print "OK: \$$rcsidstr\$ seen in $file.\n" if ($verbose);
if ($1 ne ' ') {
&perror("WARN", $file, -1, "please use single whitespace ".
"right before \$$rcsidstr\$ tag.");
}
if ($2 ne '') {
if ($verbose || $newport) { # XXX
&perror("WARN", $file, -1,
($newport ? 'for new port, '
: 'is it a new port? if so, ').
"make \$$rcsidstr\$ tag in comment ".
"section empty, to make SVN happy.");
}
}
}
#
# for the rest of the checks, comment lines are not important.