diff options
author | marcus <marcus@FreeBSD.org> | 2011-06-27 05:31:55 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2011-06-27 05:31:55 +0800 |
commit | be4c4f22b847692b7230d8753f0486970c46dabe (patch) | |
tree | 2d953144c7c4b316c238390cc1ca302cd1a8f2c1 /ports-mgmt | |
parent | b37d40cb09da51c12a13b09a81cbb2bd027ba0a4 (diff) | |
download | freebsd-ports-gnome-be4c4f22b847692b7230d8753f0486970c46dabe.tar.gz freebsd-ports-gnome-be4c4f22b847692b7230d8753f0486970c46dabe.tar.zst freebsd-ports-gnome-be4c4f22b847692b7230d8753f0486970c46dabe.zip |
Update to 2.13.6.
* Be more careful is searching for WITH(OUT)_FOO OPTIONS checks so to avoid
false positive warnings. [1]
* Support := in the *_DEPENDS section. [2]
* Make sure we expand DISTNAME to catch potential superfluous uses of it. [3]
* Fix the error seen when one passes CPPFLAGS to CONFIGURE_ENV. [4]
* Add the license block check after the MAINTAINER block [5]
* Add a check for use of ${FIND}...${XARGS} ${RM}. [6]
PR: 156164 [1]
155753 [2]
154320 [3]
158305 [5]
157566 [6]
Submitted by: sahil [1]
"Ilya A. Arkhipov" <micro@heavennet.ru> [5]
Reported by: pav [4]
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/portlint/Makefile | 9 | ||||
-rw-r--r-- | ports-mgmt/portlint/pkg-plist | 3 | ||||
-rw-r--r-- | ports-mgmt/portlint/src/portlint.pl | 93 |
3 files changed, 74 insertions, 31 deletions
diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index fba03ed32300..85c863461126 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -8,7 +8,7 @@ # PORTNAME= portlint -PORTVERSION= 2.13.5 +PORTVERSION= 2.13.6 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none @@ -23,6 +23,12 @@ USE_PERL5_RUN= yes SRC= ${.CURDIR}/src MAN1= portlint.1 +PLIST_FILES= bin/portlint + +.if !defined(NOPORTEXAMPLES) +PLIST_FILES+= %%EXAMPLESDIR%%/portlintgrep +PLIST_DIRS= %%EXAMPLESDIR%% +.endif do-fetch: @${DO_NADA} @@ -38,7 +44,6 @@ post-patch: do-install: ${INSTALL_SCRIPT} ${WRKSRC}/portlint.pl ${PREFIX}/bin/portlint ${INSTALL_MAN} ${WRKSRC}/portlint.1 ${MAN1PREFIX}/man/man1 - ${MKDIR} ${EXAMPLESDIR} .if !defined(NOPORTEXAMPLES) ${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m ${BINMODE} -d ${EXAMPLESDIR} ${INSTALL_SCRIPT} ${WRKSRC}/portlintgrep.pl ${EXAMPLESDIR}/portlintgrep diff --git a/ports-mgmt/portlint/pkg-plist b/ports-mgmt/portlint/pkg-plist deleted file mode 100644 index 993b632c0118..000000000000 --- a/ports-mgmt/portlint/pkg-plist +++ /dev/null @@ -1,3 +0,0 @@ -bin/portlint -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/portlintgrep -@dirrm %%EXAMPLESDIR%% diff --git a/ports-mgmt/portlint/src/portlint.pl b/ports-mgmt/portlint/src/portlint.pl index 9b55324197fd..aaf76af3c0ff 100644 --- a/ports-mgmt/portlint/src/portlint.pl +++ b/ports-mgmt/portlint/src/portlint.pl @@ -17,7 +17,7 @@ # OpenBSD and NetBSD will be accepted. # # $FreeBSD$ -# $MCom: portlint/portlint.pl,v 1.216 2011/03/21 00:58:39 marcus Exp $ +# $MCom: portlint/portlint.pl,v 1.223 2011/06/26 21:25:51 marcus Exp $ # use strict; @@ -52,7 +52,7 @@ $portdir = '.'; # version variables my $major = 2; my $minor = 13; -my $micro = 5; +my $micro = 6; sub l { '[{(]'; } sub r { '[)}]'; } @@ -1541,7 +1541,7 @@ sub checkmakefile { pos($whole) = 0; print "OK: checking OPTIONS.\n" if ($verbose); @oopt = ($makevar{OPTIONS} =~ /(\w+)\s+\".*?\"\s+\w+/sg); - while ($whole =~ /\n[^#\n]*?\(?\s*WITH(?:OUT)?_(\w+)\s*\)?/mg) { + while ($whole =~ /\(?\s*WITH(?:OUT)?_(\w+)\s*\)?/mg) { push @mopt, $1; my $lineno = &linenumber($`) + 1; &perror("FATAL", $file, $lineno, "option WITH(OUT)_$1 is used before ". @@ -1917,6 +1917,18 @@ ruby sed sh sort sysctl touch tr which xargs xmkmf } # + # check for use of ${FIND} ... ${XARGS} ${RM} + # + print "OK: checking for instances of \${FIND} ... \${XARGS} \${RM}.\n" + if ($verbose); + if ($j =~ /\$\{FIND\}.*\|.*\$\{XARGS\}.*\$\{RM\}/) { + my $lineno = &linenumber($`); + &perror("WARN", $file, $lineno, "possible use of ". + "\"\${FIND} ... \${XARGS} \${RM}\" when ". + "\"\${FIND} ... -delete\" will work."); + } + + # # whole file: ${MACHINE_ARCH} # print "OK: checking for instances of \${MACHINE_ARCH} being test.\n" @@ -2101,13 +2113,19 @@ ruby sed sh sort sysctl touch tr which xargs xmkmf if ($configure_env =~ /(FC)=/ || $configure_env =~ /(F77)=/ || - $configure_env =~ /(CPPFLAGS)=/ || $configure_env =~ /(FFLAGS)=/) { &perror("FATAL", $file, -1, "$1 is already ". "passed in CONFIGURE_ENV via bsd.gcc.mk. If you need to ". "override the default value, alter $1 in the Makefile ". "instead with $1=..."); } + + if ($configure_env =~ /(CPPFLAGS)=/) { + &perror("FATAL", $file, -1, "$1 is already ". + "passed in CONFIGURE_ENV via bsd.port.mk. If you need to ". + "override the default value, alter $1 in the Makefile ". + "instead with $1=..."); + } } # @@ -2234,7 +2252,6 @@ EOF } # - # # section 2: PORTNAME/PORTVERSION/... # print "OK: checking first section of $file (PORTNAME/...).\n" @@ -2393,21 +2410,6 @@ DIST_SUBDIR EXTRACT_ONLY } } - # check value of LICENSE_COMB - if ($makevar{LICENSE_COMB} && $makevar{LICENSE_COMB} !~ /^(single|dual|multi$)/) { - &perror("FATAL", $file, -1, "LICENSE_COMB contains invalid value '$1' - must be one of 'single', 'dual', 'multi'"); - } - - # check LICENSE - if ($makevar{LICENSE} && $makevar{LICENSE} ne '') { - my $comb = $makevar{LICENSE_COMB} // 'single'; - - my @tokens = split(/ /, $makevar{LICENSE}); - if ($comb eq 'single' && scalar(@tokens) > 1) { - &perror("FATAL", $file, -1, "LICENSE contains multiple licenses but LICENSE_COMB is not set to 'dual' or 'multi'"); - } - } - # check the URL if (($tmp =~ /\nMASTER_SITES[+?]?=[ \t]*([^\n]*)\n/ && $1 !~ /^[ \t]*$/) || ($makevar{MASTER_SITES} ne '')) { @@ -2475,11 +2477,12 @@ DIST_SUBDIR EXTRACT_ONLY print "OK: sanity checking PORTNAME/PORTVERSION/DISTVERSIONPREFIX/DISTVERSION/DISTVERSIONSUFFIX.\n" if ($verbose); if ($distname ne '') { - if ($distname eq "$portname-$portversion") { + my $exp_distname = $makevar{DISTNAME}; + if ($exp_distname eq "$portname-$portversion") { &perror("WARN", $file, -1, "DISTNAME is \${PORTNAME}-\${PORTVERSION} by ". "default, you don't need to define DISTNAME."); } else { - if ($distname eq "$portname-$distversionprefix$distversion$distversionsuffix") { + if ($exp_distname eq "$portname-$distversionprefix$distversion$distversionsuffix") { &perror("WARN", $file, -1, "DISTNAME is \${PORTNAME}-\${DISTVERSIONPREFIX}\${DISTVERSION}\${DISTVERSIONSUFFIX} by ". "default, you don't need to define DISTNAME."); } @@ -2703,7 +2706,7 @@ PATCH_SITES PATCHFILES PATCH_DIST_STRIP # print "OK: checking third section of $file (MAINTAINER).\n" if ($verbose); - $tmp = $sections[$idx++]; + $tmp = $sections[$idx]; &checkearlier($file, $tmp, @varnames); &checkorder('MAINTAINER', $tmp, $file, qw( @@ -2756,14 +2759,52 @@ MAINTAINER COMMENT } } + $idx++; + push(@varnames, qw( MAINTAINER COMMENT )); # - # section 5: *_DEPENDS (may not be there) + # section 5: LICENSE + # + print "OK: checking fourth section of $file (LICENSE).\n" + if ($verbose); + $tmp = $sections[$idx]; + + if ($makevar{LICENSE}) { + &checkorder('LICENSE', $tmp, $file, qw( + LICENSE LICENSE_COMB LICENSE_GROUPS LICENSE_NAME + LICENSE_TEXT LICENSE_FILE LICENSE_PERMS + )); + + # check LICENSE + if ($makevar{LICENSE} && $makevar{LICENSE} ne '') { + my $comb = $makevar{LICENSE_COMB} // 'single'; + + my @tokens = split(/ /, $makevar{LICENSE}); + if ($comb eq 'single' && scalar(@tokens) > 1) { + &perror("FATAL", $file, -1, "LICENSE contains multiple licenses but LICENSE_COMB is not set to 'dual' or 'multi'"); + } + } + + # check value of LICENSE_COMB + if ($makevar{LICENSE_COMB} && $makevar{LICENSE_COMB} !~ /^(single|dual|multi$)/) { + &perror("FATAL", $file, -1, "LICENSE_COMB contains invalid value '$1' - must be one of 'single', 'dual', 'multi'"); + } + + $idx++; + + push(@varnames, qw( + LICENSE LICENSE_COMB LICENSE_GROUPS LICENSE_NAME + LICENSE_TEXT LICENSE_FILE LICENSE_PERMS + )); + } + + # + # section 6: *_DEPENDS (may not be there) # - print "OK: checking fourth section of $file (*_DEPENDS).\n" + print "OK: checking fifth section of $file (*_DEPENDS).\n" if ($verbose); $tmp = $sections[$idx]; @@ -2789,7 +2830,7 @@ FETCH_DEPENDS DEPENDS_TARGET check_depends_syntax($tmp, $file); foreach my $i (@linestocheck) { - $tmp =~ s/$i[?+]?=[^\n]+\n//g; + $tmp =~ s/$i[?+:]?=[^\n]+\n//g; } &checkextra($tmp, '*_DEPENDS', $file); |