Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Sep 2018 17:51:43 +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: r479898 - in head/ports-mgmt/portlint: . src
Message-ID:  <201809161751.w8GHphWC072692@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809161751.w8GHphWC072692>