diff options
author | marcus <marcus@FreeBSD.org> | 2015-10-26 01:27:38 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2015-10-26 01:27:38 +0800 |
commit | ab1c0bad26e9456602ef3e2060afde97a9da1081 (patch) | |
tree | 83184b5e75bb76fe62e90352026809a24a392bc9 /ports-mgmt | |
parent | 1972718b65965a9aef068ab40fb4ddc2113f9e0c (diff) | |
download | freebsd-ports-gnome-ab1c0bad26e9456602ef3e2060afde97a9da1081.tar.gz freebsd-ports-gnome-ab1c0bad26e9456602ef3e2060afde97a9da1081.tar.zst freebsd-ports-gnome-ab1c0bad26e9456602ef3e2060afde97a9da1081.zip |
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]
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/portlint/Makefile | 2 | ||||
-rw-r--r-- | ports-mgmt/portlint/src/portlint.pl | 73 |
2 files changed, 60 insertions, 15 deletions
diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index d9b72e56320c..02018037df27 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= portlint -PORTVERSION= 2.16.6 +PORTVERSION= 2.16.7 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none 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 |