Date: Fri, 14 May 2021 17:15:58 GMT From: Joe Marcus Clarke <marcus@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 122c3ecb51c4 - main - ports-mgmt/portlint: Update to 2.19.6 Message-ID: <202105141715.14EHFwkv085671@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by marcus: URL: https://cgit.FreeBSD.org/ports/commit/?id=122c3ecb51c4a8057d09d1699a962dd1987e8061 commit 122c3ecb51c4a8057d09d1699a962dd1987e8061 Author: Joe Marcus Clarke <marcus@FreeBSD.org> AuthorDate: 2021-05-14 16:57:48 +0000 Commit: Joe Marcus Clarke <marcus@FreeBSD.org> CommitDate: 2021-05-14 17:15:44 +0000 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] --- ports-mgmt/portlint/Makefile | 2 +- ports-mgmt/portlint/src/portlint.pl | 57 ++++++++++++++++++++++--------------- 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(
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105141715.14EHFwkv085671>