diff options
author | mharo <mharo@FreeBSD.org> | 2000-04-17 07:05:06 +0800 |
---|---|---|
committer | mharo <mharo@FreeBSD.org> | 2000-04-17 07:05:06 +0800 |
commit | 9ff083b1c96e7a3b5708ddac750d74eaf2fb1f60 (patch) | |
tree | 04ccc57a47693e480db7c3ee2fd8fa9021987808 /devel/portlint | |
parent | ab43fa0c8e8fff486ac16963d8fc8c3fcd8ef075 (diff) | |
download | freebsd-ports-gnome-9ff083b1c96e7a3b5708ddac750d74eaf2fb1f60.tar.gz freebsd-ports-gnome-9ff083b1c96e7a3b5708ddac750d74eaf2fb1f60.tar.zst freebsd-ports-gnome-9ff083b1c96e7a3b5708ddac750d74eaf2fb1f60.zip |
Update to 2.2.1
Fixes:
* fix some portname/version checking bugs
* put EXTRACT_ONLY in section 1 checking
* fix multi comment sections at top of Makefile regex
* make portlint pass perl -w (this found a few bugs)
No new features in this version
Diffstat (limited to 'devel/portlint')
-rw-r--r-- | devel/portlint/Makefile | 3 | ||||
-rw-r--r-- | devel/portlint/src/portlint.pl | 43 |
2 files changed, 26 insertions, 20 deletions
diff --git a/devel/portlint/Makefile b/devel/portlint/Makefile index 673f054e5450..db75174c6fd3 100644 --- a/devel/portlint/Makefile +++ b/devel/portlint/Makefile @@ -9,7 +9,7 @@ # PORTNAME= portlint -PORTVERSION= 2.2.0 +PORTVERSION= 2.2.1 CATEGORIES= devel DISTFILES= # none @@ -17,6 +17,7 @@ MAINTAINER= mharo@FreeBSD.org NO_BUILD= yes NO_WRKSUBDIR= yes +USE_PERL5= yes SRC= ${.CURDIR}/src diff --git a/devel/portlint/src/portlint.pl b/devel/portlint/src/portlint.pl index 429e4de129f9..a0d6e79eb4dc 100644 --- a/devel/portlint/src/portlint.pl +++ b/devel/portlint/src/portlint.pl @@ -17,7 +17,7 @@ # OpenBSD and NetBSD will be accepted. # # $FreeBSD$ -# $Id: portlint.pl,v 1.14 2000/04/16 19:58:15 mharo Exp $ +# $Id: portlint.pl,v 1.16 2000/04/16 22:39:57 mharo Exp $ # use vars qw/ $opt_a $opt_b $opt_c $opt_h $opt_v $opt_N $opt_B $opt_V /; @@ -460,10 +460,10 @@ sub checkplist { } # check that every infofile has an exec install-info and unexec install-info - my $exec_install = join(/ /, @exec_info); - my $exec_install .= ' '; - my $unexec_install = join(/ /, @unexec_info); - my $unexec_install .= ' '; + my $exec_install = join(" ", @exec_info); + $exec_install .= ' '; + my $unexec_install = join(" ", @unexec_info); + $unexec_install .= ' '; foreach my $if (@infofile) { next if ($if =~ m/info-/); @@ -637,8 +637,9 @@ sub checkmakefile { if ($verbose); $i = "\n" x ($contblank + 2); if ($whole =~ /$i/) { + my @linesbefore = split(/\n/, $`); &perror("FATAL: contiguous blank lines (> $contblank lines) found ". - "in $file at line " . int(split(/\n/, $`)) . "."); + "in $file at line " . ($#linesbefore + 1) . "."); } # @@ -667,7 +668,7 @@ sub checkmakefile { # whole file: PKGNAME # print "OK: checking PKGNAME.\n" if ($verbose); - if ($whole =~ /\nPKGNAME/) { + if ($whole =~ /\nPKGNAME.?=/) { &perror("FATAL: PKGNAME is obsoleted by PORTNAME, ". "PORTVERSION, PKGNAMEPREFIX and PKGNAMESUFFIX."); } @@ -756,9 +757,9 @@ EOF # $tmp = $rawwhole; # keep comment, blank line, comment in the same section - $tmp =~ s/(#.+\n)\n(#.+)/$1$2/g; + $tmp =~ s/(#.*\n)\n+(#.*)/$1$2/g; @sections = split(/\n\n+/, $tmp); - for ($i = 0; $i < scalar(@sections); $i++) { + for ($i = 0; $i <= $#sections; $i++) { if ($sections[$i] !~ /\n$/) { $sections[$i] .= "\n"; } @@ -846,22 +847,26 @@ EOF # check the order of items. &checkorder('PORTNAME', $tmp, split(/\s+/, <<EOF)); PORTNAME PORTVERSION CATEGORIES MASTER_SITES MASTER_SITE_SUBDIR -PKGNAMEPREFIX PKGNAMESUFFIX DISTNAME EXTRACT_SUFX DISTFILES +PKGNAMEPREFIX PKGNAMESUFFIX DISTNAME EXTRACT_SUFX DISTFILES EXTRACT_ONLY EOF # check the items that has to be there. $tmp = "\n" . $tmp; print "OK: checking PORTNAME/PORTVERSION.\n" if ($verbose); - if ($tmp !~ /\nPORTNAME=/) { + if ($tmp !~ /\nPORTNAME(.)?=/) { &perror("FATAL: PORTNAME has to be there."); } - if ($tmp =~ /\nPORTNAME(\?=)/) { - &perror("FATAL: PORTNAME has be set by \"=\", ". - "not by \"$1\"."); + if ($1 ne '') { + &perror("WARN: PORTNAME has be set by \"=\", ". + "not by \"$1=\"."); } - if ($tmp !~ /\nPORTVERSION=/) { + if ($tmp !~ /\nPORTVERSION(.)?=/) { &perror("FATAL: PORTVERSION has to be there."); } + if ($1 ne '') { + &perror("WARN: PORTVERSION has be set by \"=\", ". + "not by \"$1=\"."); + } print "OK: checking CATEGORIES.\n" if ($verbose); #MICHAEL: do we want to use [^\n] here? if ($tmp !~ /\nCATEGORIES(.)?=[ \t]*([^\n]*)/) { @@ -871,7 +876,7 @@ EOF $i = $1; if ($i ne '' && $i =~ /[^?+]/) { &perror("WARN: CATEGORIES should be set by \"=\", \"?=\", or \"+=\", ". - "not by \"$i\"."); + "not by \"$i=\"."); } if (@cat == 0) { @@ -1053,7 +1058,7 @@ EOF if (@tgz) { my $tgz = (2 <= @tgz) ? '{' . join(',', @tgz) . '}' - : @tgz[0]; + : $tgz[0]; &perror("WARN: be sure to remove $portdir/$tgz ". "before committing the port."); @@ -1063,7 +1068,7 @@ EOF push(@varnames, split(/\s+/, <<EOF)); PORTNAME PORTVERSION CATEGORIES MASTER_SITES MASTER_SITE_SUBDIR -PKGNAMEPREFIX PKGNAMESUFFIX DISTNAME EXTRACT_SUFX DISTFILES +PKGNAMEPREFIX PKGNAMESUFFIX DISTNAME EXTRACT_SUFX DISTFILES EXTRACT_ONLY EOF # @@ -1459,7 +1464,7 @@ sub checkorder { while ($k < scalar(@order) && $order[$k] ne $i) { $k++; } - if (@order[$k] eq $i) { + if ($order[$k] eq $i) { if ($k < $j) { &perror("FATAL: $i appears out-of-order."); $invalidorder++; |