aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2021-05-14 16:57:48 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2021-05-14 17:15:44 +0000
commit122c3ecb51c4a8057d09d1699a962dd1987e8061 (patch)
tree82826f094525a58452dd921f8886704838a3fda7 /ports-mgmt
parent4d001c7726debb69e35c96f237ec3410b70a88a4 (diff)
downloadports-122c3ecb51c4a8057d09d1699a962dd1987e8061.tar.gz
ports-122c3ecb51c4a8057d09d1699a962dd1987e8061.zip
ports-mgmt/portlint: Update to 2.19.6
* Allow ports without any leading comment section [1] loader@ submitted a patch on which this was based * Add a check to make sure the license is actually valid PR: 255520 [1]
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/portlint/Makefile2
-rw-r--r--ports-mgmt/portlint/src/portlint.pl57
2 files changed, 35 insertions, 24 deletions
diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile
index ad6edb127375..c7a08584c901 100644
--- a/ports-mgmt/portlint/Makefile
+++ b/ports-mgmt/portlint/Makefile
@@ -1,7 +1,7 @@
# Created by: Jun-ichiro itojun Hagino <itojun@itojun.org>
PORTNAME= portlint
-PORTVERSION= 2.19.5
+PORTVERSION= 2.19.6
CATEGORIES= ports-mgmt
MASTER_SITES= # none
DISTFILES= # none
diff --git a/ports-mgmt/portlint/src/portlint.pl b/ports-mgmt/portlint/src/portlint.pl
index 329821698a0b..d797c4c6a11f 100644
--- a/ports-mgmt/portlint/src/portlint.pl
+++ b/ports-mgmt/portlint/src/portlint.pl
@@ -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.525 2021/04/19 20:48:32 jclarke Exp $
+# $MCom: portlint/portlint.pl,v 1.528 2021/05/14 16:53:31 jclarke Exp $
#
use strict;
@@ -49,7 +49,7 @@ $portdir = '.';
# version variables
my $major = 2;
my $minor = 19;
-my $micro = 5;
+my $micro = 6;
# default setting - for FreeBSD
my $portsdir = '/usr/ports';
@@ -2663,34 +2663,39 @@ xargs xmkmf
}
}
$idx = 0;
+ my @linestocheck = ();
- #
- # section 1: comment lines.
- #
- print "OK: checking comment section of $file.\n" if ($verbose);
- my @linestocheck = split("\n", <<EOF);
+ # check if all lines in the first section are comments
+ if (grep(/^#/, split(/\n/, $sections[$idx])) == split(/\n/, $sections[$idx])) {
+
+ #
+ # section 1: comment lines.
+ #
+ print "OK: checking comment section of $file.\n" if ($verbose);
+ @linestocheck = split("\n", <<EOF);
Whom
Date [cC]reated
EOF
- $tmp = $sections[$idx++];
- $tmp = "\n" . $tmp; # to make the begin-of-line check easier
+ $tmp = $sections[$idx++];
+ $tmp = "\n" . $tmp; # to make the begin-of-line check easier
- if ($tmp =~ /\n[^#]/) {
- &perror("FATAL", $file, -1, "non-comment line in comment section.");
- }
- if ($tmp =~ m/Version [rR]equired/) {
- &perror("WARN", $file, -1, "Version required is no longer needed in the comment section.");
- }
+ if ($tmp =~ /\n[^#]/) {
+ &perror("FATAL", $file, -1, "non-comment line in comment section.");
+ }
+ if ($tmp =~ m/Version [rR]equired/) {
+ &perror("WARN", $file, -1, "Version required is no longer needed in the comment section.");
+ }
- #
- # for the rest of the checks, comment lines are not important.
- #
- for ($i = 0; $i < scalar(@sections); $i++) {
- $sections[$i] = "\n" . $sections[$i];
- $sections[$i] =~ s/\n#[^\n]*//g;
- $sections[$i] =~ s/\n\n+/\n/g;
- $sections[$i] =~ s/^\n//;
+ #
+ # for the rest of the checks, comment lines are not important.
+ #
+ for ($i = 0; $i < scalar(@sections); $i++) {
+ $sections[$i] = "\n" . $sections[$i];
+ $sections[$i] =~ s/\n#[^\n]*//g;
+ $sections[$i] =~ s/\n\n+/\n/g;
+ $sections[$i] =~ s/^\n//;
+ }
}
#
@@ -3224,6 +3229,12 @@ MAINTAINER COMMENT
}
}
+ # Last-ditch check to make sure the license is sanely defined.
+ my $lic_check = system("make check-license 2>&1 >/dev/null");
+ if ($lic_check) {
+ &perror("FATAL", $file, -1, "Failed to validate port LICENSE '$makevar{LICENSE}' with ``make check-license''");
+ }
+
$idx++;
push(@varnames, qw(