Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 2017 23:46:54 +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: r457486 - in head/ports-mgmt/portlint: . src
Message-ID:  <201712282346.vBSNksGB083449@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcus
Date: Thu Dec 28 23:46:54 2017
New Revision: 457486
URL: https://svnweb.freebsd.org/changeset/ports/457486

Log:
  Update to 2.17.15.
  
  * Don't check for direct command use for ONLY_FOR_ARCHS_REASON
    and NOT_FOR_ARCHS_REASON when a specific arch has been specified. [1]
  * Preserve an original variable value to make sure the check for copying
    dependecies is actually performed.
  * Don't complain about incon installation if the port is a Qt5 port. [2]
  * Check that PLIST_FILES entries do not contain %%FOO% notation. [3]
  * Check that DOCS and EXAMPLES are defined as OPTIONS when using %%PORTDOCS%%
    and %%PORTEXAMPLES%%. [4]
  * Check that if USE_LDCONFIG is defined, then the port installs shared
    objects. [5]
  * Check that when USE_KDE is defined, then USES=kde:5 is also defined. [6]
  * Ignore flavors when trying to find port directories. [7]
  * Revert the fix for 221971 (USE_GITHUB).  More debate is needed here.
  
  PR:		223285 [1]
  		223498 [2]
  		223539 [3]
  		223541 [4]
  		223762 [5]
  		224140 [6]
  		224245 [7]
  Submitted by:	adridg [2]
  		mat [4]
  		224245 [7]

Modified:
  head/ports-mgmt/portlint/Makefile
  head/ports-mgmt/portlint/src/portlint.pl

Modified: head/ports-mgmt/portlint/Makefile
==============================================================================
--- head/ports-mgmt/portlint/Makefile	Thu Dec 28 22:45:57 2017	(r457485)
+++ head/ports-mgmt/portlint/Makefile	Thu Dec 28 23:46:54 2017	(r457486)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	portlint
-PORTVERSION=	2.17.14
+PORTVERSION=	2.17.15
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none

Modified: head/ports-mgmt/portlint/src/portlint.pl
==============================================================================
--- head/ports-mgmt/portlint/src/portlint.pl	Thu Dec 28 22:45:57 2017	(r457485)
+++ head/ports-mgmt/portlint/src/portlint.pl	Thu Dec 28 23:46:54 2017	(r457486)
@@ -15,7 +15,7 @@
 # was removed.
 #
 # $FreeBSD$
-# $MCom: portlint/portlint.pl,v 1.432 2017/12/07 03:23:53 jclarke Exp $
+# $MCom: portlint/portlint.pl,v 1.443 2017/12/28 23:42:15 jclarke Exp $
 #
 
 use strict;
@@ -50,7 +50,7 @@ $portdir = '.';
 # version variables
 my $major = 2;
 my $minor = 17;
-my $micro = 14;
+my $micro = 15;
 
 # default setting - for FreeBSD
 my $portsdir = '/usr/ports';
@@ -153,7 +153,7 @@ 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 INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION
+	USE_GNOME USE_PERL5 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
@@ -218,7 +218,7 @@ my $ulineno = -1;
 my $uulineno = -1;
 my @muses = ();
 while (my $mline = <MK>) {
-	if ($uulineno == -1 && $mline =~ /^USE_/ && $mline !~ /^USE_GITHUB/) {
+	if ($uulineno == -1 && $mline =~ /^USE_/) {
 		$uulineno = $.;
 	}
     if ($mline =~ /^USES[?+]?=\s*(.*)/) {
@@ -558,6 +558,7 @@ sub checkplist {
 	my $item_count = 0;
 	my $owner_seen = 0;
 	my $group_seen = 0;
+	my $found_so = 0;
 
 	# Variables that are allowed to be out-of-sync in the XXXDIR check.
 	# E.g., %%PORTDOCS%%%%RUBY_MODDOCDIR%% will be OK because there is
@@ -773,10 +774,13 @@ sub checkplist {
 			$makevar{USE_LDCONFIG} eq '') {
 			&perror("WARN", $file, $., "installing shared libraries, ".
 				"please define USE_LDCONFIG as appropriate");
+		} elsif ($_ =~ m|lib[^\/]+\.so(\.\d+)?$|) {
+			$found_so++;
 		}
 
 		if ($_ =~ m|^share/icons/.*/| &&
-			$makevar{INSTALLS_ICONS} eq '') {
+			$makevar{INSTALLS_ICONS} eq '' &&
+			needs_installs_icons()) {
 			&perror("WARN", $file, $., "installing icons, ".
 				"please define INSTALLS_ICONS as appropriate");
 		}
@@ -904,6 +908,11 @@ sub checkplist {
 		&perror("WARN", $file, -1, "There are only $item_count items in the plist.  Consider using PLIST_FILES instead of pkg-plist when installing less than $numpitems items.");
 	}
 
+	if ($makevar{USE_LDCONFIG} ne '' && !$found_so) {
+		&perror("WARN", $file, -1, "You have defined USE_LDCONFIG, but this ".
+			"port does not install any shared objects.");
+	}
+
 	close(IN);
 	1;
 }
@@ -1074,6 +1083,7 @@ sub check_depends_syntax {
 			if ($k =~ /^#/) {
 				last;
 			}
+			my $ok = $k;
 			if ($k =~ /^\$\{(\w+)\}$/) {
 				$k = get_makevar($1);
 			}
@@ -1084,8 +1094,8 @@ sub check_depends_syntax {
 
 			print "OK: checking dependency value for $j.\n"
 				if ($verbose);
-			if ($k =~ /\$\{((PATCH_|EXTRACT_|LIB_|BUILD_|RUN_|TEST_|FETCH_)*DEPENDS)}/) {
-				&perror("WARN", $file, -1, "do not set $j to $k. ".
+			if ($ok =~ /\$\{((PATCH_|EXTRACT_|LIB_|BUILD_|RUN_|TEST_|FETCH_)*DEPENDS)}/) {
+				&perror("WARN", $file, -1, "do not set $j to $ok. ".
 					"Instead, explicity list out required $j dependencies.");
 			}
 
@@ -1099,7 +1109,7 @@ sub check_depends_syntax {
 			}
 			my %m = ();
 			$m{'dep'} = $l[0];
-			$m{'dir'} = $l[1];
+			$m{'dir'} = (split(/\@/, $l[1]))[0];
 			$m{'tgt'} = $l[2] // '';
 			my %depmvars = ();
 			foreach my $dv ($m{'dep'}, $m{'dir'}, $m{'tgt'}) {
@@ -1474,10 +1484,15 @@ sub checkmakefile {
 					"If possible, install this file with a different name.");
 			}
 			if ($plist_file =~ m|^share/icons/.*/| &&
-				$makevar{INSTALLS_ICONS} eq '') {
+				$makevar{INSTALLS_ICONS} eq '' &&
+		        needs_installs_icons()) {
 				&perror("WARN", "", -1, "PLIST_FILES: installing icons, ".
 					"please define INSTALLS_ICONS as appropriate");
 			}
+			if ($plist_file =~ /%%[\w_\d]+%%/) {
+				&perror("FATAL", "", -1, "PLIST_FILES: files cannot contain ".
+					"%%FOO%% variables.  Use make variables and logic instead");
+			}
 
 		}
 	}
@@ -1650,6 +1665,20 @@ sub checkmakefile {
 		my %seen = ();
 		@popt = grep { !$seen{$_}++ } @popt;
 	}
+	foreach my $i (@popt) {
+		if ($i eq 'PORTDOCS') {
+			if (!grep(/^DOCS$/, @opt)) {
+				&perror("FATAL", $file, -1, "PORTDOCS appears in plist ".
+					"but DOCS is not listed in OPTIONS_DEFINE.");
+			}
+		} elsif ($i eq 'PORTEXAMPLES') {
+			if (!grep(/^EXAMPLES$/, @opt)) {
+				&perror("FATAL", $file, -1, "PORTEXAMPLES appears in plist ".
+					"but EXAMPLES is not listed in OPTIONS_DEFINE.");
+			}
+		}
+	}
+
 	foreach my $i ((@opt, @aopt)) {
 		# 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');
@@ -1823,6 +1852,14 @@ sub checkmakefile {
 	}
 
 	#
+	# whole file: using INSTALLS_ICONS when it is not wanted
+	#
+	if (!($makevar{INSTALLS_ICONS} eq '') &&
+		!needs_installs_icons()) {
+		&perror("WARN", $file, -1, "INSTALLS_ICONS is set, but should not be.");
+	}
+
+	#
 	# whole file: EXPIRATION_DATE
 	#
 	print "OK: checking for valid EXPIRATION_DATE.\n" if ($verbose);
@@ -1999,8 +2036,8 @@ xargs xmkmf
 				&& $curline !~ /^CATEGORIES(.)?=[^\n]+$i/m
 				&& $curline !~ /^(\w+)?USES(.)?=[^\n]+$i/m
 				&& $curline !~ /^WX_COMPS(.)?=[^\n]+$i/m
-				&& $curline !~ /^ONLY_FOR_ARCHS_REASON(.)?=[^\n]+$i/m
-				&& $curline !~ /^NOT_FOR_ARCHS_REASON(.)?=[^\n]+$i/m
+				&& $curline !~ /^ONLY_FOR_ARCHS_REASON(_[\w\d]+)?(.)?=[^\n]+$i/m
+				&& $curline !~ /^NOT_FOR_ARCHS_REASON(_[\w\d]+)?(.)?=[^\n]+$i/m
 				&& $curline !~ /^SHEBANG_FILES(.)?=[^\n]+$i/m
 				&& $curline !~ /^[A-Z0-9_]+_DESC=[^\n]+$i/m
 				&& $curline !~ /^\s*#.+$/m
@@ -2186,6 +2223,17 @@ xargs xmkmf
 	}
 
 	#
+	# whole file: USE_KDE check
+	#
+	if ($whole =~ /^USE_KDE[?:]?=\s*(.*)$/m) {
+		if ($makevar{USES} !~ /\bkde:5/) {
+			my $lineno = &linenumber($`);
+			&perror("WARN", $file, $lineno, "USE_KDE is defined without ".
+				"defining USES=kde:5");
+		}
+	}
+
+	#
 	# whole file: USE_GCC checks
 	#
 	if ($whole =~ /^USE_GCC[?:]?=\s*([^\s#]*).*$/m) {
@@ -3569,6 +3617,13 @@ sub urlcheck {
 				"extra \":\".");
 	}
 }
+
+# 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 ''
+}
+
 sub TRUE {1;}
 
 # Local variables:



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