summaryrefslogtreecommitdiff
path: root/ports-mgmt/portlint/src
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2015-10-25 17:27:38 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2015-10-25 17:27:38 +0000
commit57a4c69296f20741d9c9bfe0c8dd14e9a48a5e06 (patch)
tree83184b5e75bb76fe62e90352026809a24a392bc9 /ports-mgmt/portlint/src
parentUpgrade to 0.4.1. (diff)
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]
Notes
Notes: svn path=/head/; revision=400154
Diffstat (limited to 'ports-mgmt/portlint/src')
-rw-r--r--ports-mgmt/portlint/src/portlint.pl73
1 files changed, 59 insertions, 14 deletions
diff --git a/ports-mgmt/portlint/src/portlint.pl b/ports-mgmt/portlint/src/portlint.pl
index ce8cb738d62d..7c03dd10ba6e 100644
--- a/ports-mgmt/portlint/src/portlint.pl
+++ b/ports-mgmt/portlint/src/portlint.pl
@@ -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