From owner-svn-ports-head@freebsd.org Sun Sep 16 17:51:44 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D5210A6CD9; Sun, 16 Sep 2018 17:51:44 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 294B171F72; Sun, 16 Sep 2018 17:51:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 241F4256B0; Sun, 16 Sep 2018 17:51:44 +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 w8GHph6f072694; Sun, 16 Sep 2018 17:51:43 GMT (envelope-from marcus@FreeBSD.org) Received: (from marcus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8GHphWC072692; Sun, 16 Sep 2018 17:51:43 GMT (envelope-from marcus@FreeBSD.org) Message-Id: <201809161751.w8GHphWC072692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcus set sender to marcus@FreeBSD.org using -f From: Joe Marcus Clarke Date: Sun, 16 Sep 2018 17:51:43 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r479898 - 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: 479898 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.27 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: Sun, 16 Sep 2018 17:51:44 -0000 Author: marcus Date: Sun Sep 16 17:51:43 2018 New Revision: 479898 URL: https://svnweb.freebsd.org/changeset/ports/479898 Log: Update to 2.18.4. * Do not complain about icon installation if USE_QT is defined [1] * Add support for checking LICENSE_PERMS [2] * Add a warning when NO_PACKAGE is used [2] * Per the Porter's handbook, check for sections for USE/USES and FLAVORS [3] * Check for -on/-off in OPTION names [4] * Check to make sure the correct LICENSE_FILE_foo is specified [5] PR: 231122 [1] 231155 [2] 230594 [3] 229280 [4] 231303 [5] Submitted by: loader [3] adamw [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 Sun Sep 16 17:16:02 2018 (r479897) +++ head/ports-mgmt/portlint/Makefile Sun Sep 16 17:51:43 2018 (r479898) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= portlint -PORTVERSION= 2.18.3 +PORTVERSION= 2.18.4 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none Modified: head/ports-mgmt/portlint/src/portlint.pl ============================================================================== --- head/ports-mgmt/portlint/src/portlint.pl Sun Sep 16 17:16:02 2018 (r479897) +++ head/ports-mgmt/portlint/src/portlint.pl Sun Sep 16 17:51:43 2018 (r479898) @@ -15,7 +15,7 @@ # was removed. # # $FreeBSD$ -# $MCom: portlint/portlint.pl,v 1.467 2018/06/24 16:07:04 jclarke Exp $ +# $MCom: portlint/portlint.pl,v 1.473 2018/09/16 17:48:44 jclarke Exp $ # use strict; @@ -50,7 +50,7 @@ $portdir = '.'; # version variables my $major = 2; my $minor = 18; -my $micro = 3; +my $micro = 4; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -153,14 +153,14 @@ my @varlist = qw( WRKDIR WRKSRC NO_WRKSUBDIR SCRIPTDIR FILESDIR PKGDIR COMMENT DESCR PLIST PKGCATEGORY PKGINSTALL PKGDEINSTALL PKGREQ PKGMESSAGE DISTINFO_FILE .CURDIR USE_LDCONFIG USE_AUTOTOOLS - USE_GNOME USE_PERL5 USE_QT5 INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION + USE_GNOME USE_PERL5 USE_QT USE_QT5 INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PLIST_FILES PLIST_DIRS PORTDOCS PORTEXAMPLES OPTIONS_DEFINE OPTIONS_RADIO OPTIONS_SINGLE OPTIONS_MULTI OPTIONS_GROUP OPTIONS_SUB INSTALLS_OMF USE_RC_SUBR USES DIST_SUBDIR ALLFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS GNU_CONFIGURE CONFIGURE_ARGS MASTER_SITE_SUBDIR LICENSE LICENSE_COMB NO_STAGE DEVELOPER SUB_FILES SHEBANG_LANG MASTER_SITES_SUBDIRS FLAVORS - USE_PYTHON + USE_PYTHON LICENSE_PERMS ); my %makevar; @@ -1713,7 +1713,7 @@ sub checkmakefile { # skip global options next if ($i eq 'DOCS' or $i eq 'NLS' or $i eq 'EXAMPLES' or $i eq 'IPV6' or $i eq 'X11' or $i eq 'DEBUG'); if (!grep(/^$i$/, (@mopt, @popt))) { - if ($whole !~ /\n${i}_($m)(_\w+)?(.)?=[^\n]+/) { + if ($whole !~ /\n${i}_($m)(_\w+)?(.)?=[^\n]+/ and $whole !~ /\n[-\w]+-${i}-(on|off):\n/) { if (!$slaveport) { &perror("WARN", $file, -1, "$i is listed in ". "OPTIONS_DEFINE, but no PORT_OPTIONS:M$i appears."); @@ -3101,6 +3101,21 @@ MAINTAINER COMMENT &perror("FATAL", $file, -1, "LICENSE_COMB contains invalid value '$1' - must be one of 'single', 'dual', 'multi'"); } + # Check for proper license file usage + if ($tmp =~ /\nLICENSE_FILE_([^\s=]+)([\s=])/) { + my $lfn = $1; + my $nchar = $2; + if ($lfn ne $makevar{LICENSE}) { + &perror("FATAL", $file, -1, "license specified is $makevar{LICENSE}, ". + "but LICENSE_FILE specified is for $lfn."); + } + + if ($lfn =~ /\+$/ && $nchar eq '=') { + &perror("WARN", $file, -1, "if license ends with a '+', make sure ". + "LICENSE_FILE_$lfn is followed by a space before the '='."); + } + } + $idx++; push(@varnames, qw( @@ -3184,9 +3199,56 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET push(@varnames, @linestocheck); &checkearlier($file, $tmp, @varnames); + # section 8: FLAVORS/FLAVOR(optional) # - # Makefile 7: check the rest of file + print "OK: check eighth section of $file (FLAVORS: optional).\n" + if ($verbose); + $tmp = $sections[$idx] // ''; + + if ($tmp =~ /(FLAVORS|FLAVOR)/) { + &checkearlier($file, $tmp, @varnames); + + $idx++; + } + + push(@varnames, qw( + FLAVORS FLAVOR + )); + + # section 9: USES/USE_x(optional) # + print "OK: check ninth section of $file (USES: optional).\n" + if ($verbose); + $tmp = $sections[$idx] // ''; + + if ($tmp =~ /(USES|USE_)/) { + &checkearlier($file, $tmp, @varnames); + + foreach my $line (split(/(USE(?:S[?+]|[_\w\d]+)?=[^\n]+\n)/, $tmp)) { + if ($line =~ /USES[?+]?=[^\n]+\n/) { + print "OK: seen USES.\n" if ($verbose); + $tmp =~ s/USES[?+]?=[^\n]+\n//; + next; + } + if ($line =~ /USE([_\w\d]+)=[^\n]+\n/) { + print "OK: seen USE$1.\n" if ($verbose); + $tmp =~ s/USE([_\w\d]+)=[^\n]+\n//; + next; + } + } + + &checkextra($tmp, 'USES/USE_x', $file); + + $idx++; + } + + push(@varnames, qw( + USES + )); + + # + # Makefile 10: check the rest of file + # print "OK: checking the rest of the $file.\n" if ($verbose); $tmp = join("\n\n", @sections[$idx .. scalar(@sections)-1]); @@ -3253,11 +3315,18 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET # check RESTRICTED/NO_CDROM/NO_PACKAGE print "OK: checking RESTRICTED/NO_CDROM/NO_PACKAGE.\n" if ($verbose); - if ($committer && $tmp =~ /\n(RESTRICTED|NO_CDROM|NO_PACKAGE)[+?]?=/) { - &perror("WARN", $file, -1, "\"$1\" found. do not forget to update ". - "ports/LEGAL."); + my $lps = $makevar{LICENSE_PERMS} // ''; + if ($committer && ($tmp =~ /\n(RESTRICTED|NO_CDROM|NO_PACKAGE)[+?]?=/ || + $lps =~ /\bno-\b/)) { + &perror("WARN", $file, -1, "Restrictive licensing found. ". + "Do not forget to update ports/LEGAL."); } + if ($tmp =~ /\nNO_PACKAGE[+?]?=/) { + &perror("WARN", $file, -1, "NO_PACKAGE is obsolete. It should be ". + "replaced with \"LICENSE_PERMS=no-pkg-mirror\""); + } + # check NO_STAGE if ($makevar{NO_STAGE}) { &perror("FATAL", $file, -1, "STAGE support is missing."); @@ -3302,6 +3371,7 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET "you do not need $1."); } + # check direct use of important make targets. if ($tmp =~ /\n(fetch|extract|patch|configure|build|install):/) { &perror("FATAL", $file, -1, "direct redefinition of make target \"$1\" ". @@ -3691,7 +3761,7 @@ sub urlcheck { # GNOME wants INSTALL_ICONS, but Qt-based applications, including KDE, don't. # Be pessimistic: everything needs it unless we know it doesn't. sub needs_installs_icons { - return $makevar{USE_QT5} eq '' + return $makevar{USE_QT5} eq '' && $makevar{USE_QT} eq '' } sub TRUE {1;}