Date: Tue, 15 Aug 2017 12:43:14 +0000 (UTC) From: Joe Marcus Clarke <marcus@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r447981 - in head/ports-mgmt/portlint: . src Message-ID: <201708151243.v7FChEAF043279@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcus Date: Tue Aug 15 12:43:14 2017 New Revision: 447981 URL: https://svnweb.freebsd.org/changeset/ports/447981 Log: Update to 2.17.12. * Don't check for absolute paths inside make variables [1] * Check pkg-plist for use of OPTIONS [1] * Fix an issue with line number offsets [2] * Don't alert on double-dollar (VARIABLE) [3] * Allow BROKEN, IGNORE, DEPRECATED to appear before the *_DEPENDS block [4] * Check that manpages are not installed into share/man [5] * Check for a space anywhere between a variable and its value [6] PR: 221507 [1] 221291 [2] 221397 [3] 221377 [4] 221455 [5] 221219 [6] Submitted by: Dmitri Goutnik <dg@syrec.org> [4] Modified: head/ports-mgmt/portlint/Makefile head/ports-mgmt/portlint/src/portlint.pl Modified: head/ports-mgmt/portlint/Makefile ============================================================================== --- head/ports-mgmt/portlint/Makefile Tue Aug 15 12:40:48 2017 (r447980) +++ head/ports-mgmt/portlint/Makefile Tue Aug 15 12:43:14 2017 (r447981) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= portlint -PORTVERSION= 2.17.11 +PORTVERSION= 2.17.12 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none Modified: head/ports-mgmt/portlint/src/portlint.pl ============================================================================== --- head/ports-mgmt/portlint/src/portlint.pl Tue Aug 15 12:40:48 2017 (r447980) +++ head/ports-mgmt/portlint/src/portlint.pl Tue Aug 15 12:43:14 2017 (r447981) @@ -15,7 +15,7 @@ # was removed. # # $FreeBSD$ -# $MCom: portlint/portlint.pl,v 1.417 2017/08/03 12:52:43 jclarke Exp $ +# $MCom: portlint/portlint.pl,v 1.424 2017/08/15 12:38:42 jclarke Exp $ # use strict; @@ -50,7 +50,7 @@ $portdir = '.'; # version variables my $major = 2; my $minor = 17; -my $micro = 11; +my $micro = 12; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -865,6 +865,11 @@ sub checkplist { "accordingly.") unless ($check_xxxdir_ok{$3} eq $1); } + if ($_ =~ m#share/man/#) { + &perror("FATAL", $file, $., "Man pages must be installed into ". + "``man'' not ``share/man''."); + } + if ($_ =~ m#man/([^/]+/)?man[1-9ln]/([^\.]+\.[1-9ln])(\.gz)?$#) { if (!$3) { &perror("FATAL", $file, $., "Unpacked man file $2 listed. ". @@ -1302,7 +1307,7 @@ sub checkmakefile { "indentation"); } if ($usetabs) { - if (m/^[A-Za-z0-9_-]+.?= /) { + if (m/^[A-Za-z0-9_-]+.?=\t*? \t*?/) { if (m/[?+]=/) { &perror("WARN", $file, $., "use a tab (not space) after a ". "variable name"); @@ -1358,7 +1363,7 @@ sub checkmakefile { # if ($parenwarn) { print "OK: checking for \$(VARIABLE).\n" if ($verbose); - if ($whole =~ /\$\([\w\d]+\)/) { + if ($whole =~ /[^\$]\$\([\w\d]+\)/) { my $lineno = &linenumber($`); &perror("WARN", $file, $lineno, "use \${VARIABLE}, instead of ". "\$(VARIABLE)."); @@ -1629,6 +1634,16 @@ sub checkmakefile { } } } + if (-f 'pkg-plist') { + open(PL, 'pkg-plist'); + my @pcontents = <PL>; + close(PL); + foreach my $i (@pcontents) { + while ($i =~ /\%\%([^%]+)\%\%/g) { + push @popt, $1; + } + } + } # special cases for PORTDOCS/PORTEXAMPLES push @popt, "DOCS" if $makevar{PORTDOCS}; push @popt, "EXAMPLES" if $makevar{PORTEXAMPLES}; @@ -2989,12 +3004,34 @@ MAINTAINER COMMENT } # - # section 6: *_DEPENDS (may not be there) + # section 6: BROKEN/IGNORE/DEPRECATED (may not be there) # - print "OK: checking fifth section of $file (*_DEPENDS).\n" + print "OK: checking sixth section of $file (BROKEN/IGNORE/DEPRECATED).\n" if ($verbose); $tmp = $sections[$idx] // ''; + @linestocheck = qw( +DEPRECATED EXPIRATION_DATE FORBIDDEN BROKEN(_\w+)? IGNORE(_\w+)? +ONLY_FOR_ARCHS ONLY_FOR_ARCHS_REASON(_\w+)? +NOT_FOR_ARCHS NOT_FOR_ARCHS_REASON(_\w+)? + ); + + my $brokenpattern = "^(" . join("|", @linestocheck) . ")[?+:]?="; + + if ($tmp =~ /$brokenpattern/) { + $idx++; + } + + push(@varnames, @linestocheck); + &checkearlier($file, $tmp, @varnames); + + # + # section 7: *_DEPENDS (may not be there) + # + print "OK: checking seventh section of $file (*_DEPENDS).\n" + if ($verbose); + $tmp = $sections[$idx] // ''; + # Check for direct assignment of BUILD_DEPENDS to RUN_DEPENDS. if ($tmp =~ /\nRUN_DEPENDS=[ \t]*\$\{BUILD_DEPENDS}/) { &perror("FATAL", $file, -1, "RUN_DEPENDS should not be set to ". @@ -3357,8 +3394,8 @@ sub checkearlier { print "OK: checking items that has to appear earlier.\n" if ($verbose); foreach my $i (@varnames) { - if ($str =~ /\n$i\??=/) { - &perror("WARN", $file, -1, "\"$i\" has to appear earlier."); + if ($str =~ /\n($i)\??=/) { + &perror("WARN", $file, -1, "\"$1\" has to appear earlier."); } } } @@ -3369,7 +3406,7 @@ sub linenumber { @lines = split /\n/, $text; - return scalar(@lines); + return scalar(@lines) - 1; } sub abspathname { @@ -3400,6 +3437,11 @@ sub abspathname { if ($pre =~ /MASTER_SITE_SUBDIR/) { # MASTER_SITE_SUBDIR lines are ok. + $i = ''; + } + if ($s =~ /\$\{[^}]*?$i/) { + # If we're inside a make variable, we probably do not have + # an absolute path. $i = ''; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708151243.v7FChEAF043279>