From owner-svn-ports-head@freebsd.org Tue Aug 15 12:43:15 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FA64DD1A68; Tue, 15 Aug 2017 12:43:15 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 385ED6E26E; Tue, 15 Aug 2017 12:43:15 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7FChEuo043281; Tue, 15 Aug 2017 12:43:14 GMT (envelope-from marcus@FreeBSD.org) Received: (from marcus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7FChEAF043279; Tue, 15 Aug 2017 12:43:14 GMT (envelope-from marcus@FreeBSD.org) Message-Id: <201708151243.v7FChEAF043279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcus set sender to marcus@FreeBSD.org using -f From: Joe Marcus Clarke Date: Tue, 15 Aug 2017 12:43:14 +0000 (UTC) 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 X-SVN-Group: ports-head X-SVN-Commit-Author: marcus X-SVN-Commit-Paths: in head/ports-mgmt/portlint: . src X-SVN-Commit-Revision: 447981 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2017 12:43:15 -0000 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 [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 = ; + 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 = ''; } }