svn commit: r400154 - in head/ports-mgmt/portlint: . src

Joe Marcus Clarke marcus at FreeBSD.org
Sun Oct 25 17:27:40 UTC 2015


Author: marcus
Date: Sun Oct 25 17:27:38 2015
New Revision: 400154
URL: https://svnweb.freebsd.org/changeset/ports/400154

Log:
  Update to 2.16.7.
  
  * Add support for @(...) notation [1]
  * Remove the check for USES being sorted.  Order is important. [2]
  * Add support for making sure @owner and @group are properly reset [3]
  
  PR:		202570 [1]
  		203908 [2]
  		202711 [3]

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 Oct 25 16:42:56 2015	(r400153)
+++ head/ports-mgmt/portlint/Makefile	Sun Oct 25 17:27:38 2015	(r400154)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	portlint
-PORTVERSION=	2.16.6
+PORTVERSION=	2.16.7
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none

Modified: head/ports-mgmt/portlint/src/portlint.pl
==============================================================================
--- head/ports-mgmt/portlint/src/portlint.pl	Sun Oct 25 16:42:56 2015	(r400153)
+++ head/ports-mgmt/portlint/src/portlint.pl	Sun Oct 25 17:27:38 2015	(r400154)
@@ -15,7 +15,7 @@
 # was removed.
 #
 # $FreeBSD$
-# $MCom: portlint/portlint.pl,v 1.371 2015/08/09 22:21:09 jclarke Exp $
+# $MCom: portlint/portlint.pl,v 1.375 2015/10/25 17:25:28 jclarke Exp $
 #
 
 use strict;
@@ -50,7 +50,7 @@ $portdir = '.';
 # version variables
 my $major = 2;
 my $minor = 16;
-my $micro = 6;
+my $micro = 7;
 
 # default setting - for FreeBSD
 my $portsdir = '/usr/ports';
@@ -531,6 +531,8 @@ sub checkplist {
 
 	my $seen_special = 0;
 	my $item_count = 0;
+	my $owner_seen = 0;
+	my $group_seen = 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
@@ -663,6 +665,11 @@ sub checkplist {
 			} elsif ($_ eq "\@cwd") {
 				; # @cwd by itself means change directory back to the original
 				  # PREFIX.
+			} elsif ($_ =~ /^\@\(/) {
+				if ($_ !~ /^\@\([^,]*,[^,]*,[^\),]*(,[^\)]*)?\)/) {
+					&perror("WARN", $file, $., "Invalid use of \@(...). ".
+						"Arguments should be owner,group,perms[,fflags]");
+				}
 		  	} elsif ($_ =~ /^\@sample\s+(\S*)/) {
 				my $sl = $.;
 				if ($1 !~ /\.sample$/) {
@@ -670,6 +677,34 @@ sub checkplist {
 						" file that does not end in ``.sample''.  Sample".
 						" files must end in ``.sample''.");
 				}
+			} elsif ($_ =~ /^\@owner/) {
+				if ($_ =~ /^\@owner\s+.+/) {
+					if ($owner_seen > 0) {
+						&perror("WARN", $file, $., "Nested setting of \@owner ".
+							"found.  Reset \@owner before setting it again.");
+					}
+				    $owner_seen++;
+				} else {
+					if ($owner_seen == 0) {
+						&perror("WARN", $file, $., "\@owner reset seen before ".
+							"a new owner section was started.");
+					}
+					$owner_seen--;
+				}
+			} elsif ($_ =~ /^\@group/) {
+				if ($_ =~ /^\@group\s+.+/) {
+					if ($group_seen > 0) {
+						&perror("WARN", $file, $., "Nested setting of \@group ".
+							"found.  Reset \@group before setting it again.");
+					}
+					$group_seen++;
+				} else {
+					if ($group_seen == 0) {
+						&perror("WARN", $file, $., "\@group reset seen before ".
+							"a new group section was started.");
+					}
+					$group_seen--;
+				}
 			} elsif ($_ =~ /^\@(dir|dirrm|dirrmtry|rmtry|option|stopdaemon|owner|group|mode|fc|fcfontsdir|fontsdir|info|shell)\b/) {
 				; # no check made
 			} else {
@@ -808,6 +843,16 @@ sub checkplist {
 		}
 	}
 
+	if ($owner_seen > 0) {
+		&perror("WARN", $file, -1, "A \@owner section was started but never ".
+			"reset.  USe \@owner without any arguments to reset the owner");
+	}
+
+	if ($group_seen > 0) {
+		&perror("WARN", $file, -1, "A \@group section was started but never ".
+			"reset.  Use \@group without any arguments to reset the group");
+	}
+
 	if (!$seen_special && $item_count < $numpitems) {
 		&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.");
 	}
@@ -1656,18 +1701,18 @@ sub checkmakefile {
 		USE_PYTHON
 		USE_XORG
 	);
-	print "OK: checking to see if USES_* stuff is sorted.\n" if ($verbose);
-	foreach my $sorted_use (@uses_to_sort) {
-		while ($whole =~ /\n$sorted_use.?=\s*(.+)\n/g) {
-			my $lineno = &linenumber($`);
-			my $srex = $1;
-			my @suses = sort(split / /, $srex);
-			if (join(" ", @suses) ne $srex) {
-				&perror("WARN", $file, $lineno, "the options to $sorted_use ".
-					"are not sorted.  Please consider sorting them.");
-			}
-		}
-	}
+#	print "OK: checking to see if USES_* stuff is sorted.\n" if ($verbose);
+#	foreach my $sorted_use (@uses_to_sort) {
+#		while ($whole =~ /\n$sorted_use.?=\s*(.+)\n/g) {
+#			my $lineno = &linenumber($`);
+#			my $srex = $1;
+#			my @suses = sort(split / /, $srex);
+#			if (join(" ", @suses) ne $srex) {
+#				&perror("WARN", $file, $lineno, "the options to $sorted_use ".
+#					"are not sorted.  Please consider sorting them.");
+#			}
+#		}
+#	}
 
 	#
 	# whole file: USE_GNOME=pkgconfig


More information about the svn-ports-all mailing list