1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

Update to 2.6.1.

* Add a check to see if PLIST_{FILES,DIRS} is defined and pkg-plist exists.
  If so, print an error [1]
* Add a check for direct usage of iconv.\d+ and intl.\d+ instead of USE_ICONV
  and USE_GETTEXT [1]
* If %%DOCSDIR%% is used in the plist, make sure @dirrm %%DOCSDIR%% is also
  present [1]
* Don't flag a missing distinfo as FATAL [2]

Submitted by:	krion [1]
		eik [2]
This commit is contained in:
Joe Marcus Clarke 2004-05-01 02:25:00 +00:00
parent 986ee705a7
commit ce673392c8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=108065
4 changed files with 76 additions and 12 deletions

View File

@ -8,7 +8,7 @@
#
PORTNAME= portlint
PORTVERSION= 2.6.0
PORTVERSION= 2.6.1
CATEGORIES= devel
MASTER_SITES= # none
DISTFILES= # none

View File

@ -17,7 +17,7 @@
# OpenBSD and NetBSD will be accepted.
#
# $FreeBSD$
# $Id: portlint.pl,v 1.44 2004/03/26 20:42:32 marcus Exp $
# $Id: portlint.pl,v 1.46 2004/05/01 02:22:20 marcus Exp $
#
use vars qw/ $opt_a $opt_A $opt_b $opt_c $opt_h $opt_t $opt_v $opt_M $opt_N $opt_B $opt_V /;
@ -40,7 +40,7 @@ $portdir = '.';
# version variables
my $major = 2;
my $minor = 6;
my $micro = 0;
my $micro = 1;
sub l { '[{(]'; }
sub r { '[)}]'; }
@ -250,12 +250,11 @@ close(IN);
#
# check for files.
#
my @checker = ($makevar{DESCR}, 'Makefile', 'distinfo', $makevar{MD5_FILE});
my @checker = ($makevar{DESCR}, 'Makefile', $makevar{MD5_FILE});
my %checker = (
$makevar{DESCR} => 'checkdescr',
'Makefile' => 'checkmakefile',
$makevar{MD5_FILE} => 'TRUE',
'distinfo' => 'checkdistinfo',
$makevar{MD5_FILE} => 'checkdistinfo',
);
if ($extrafile) {
my @files = (
@ -584,6 +583,8 @@ sub checkplist {
my(@omffile) = ();
my(@infofile) = ();
my $seen_dirrm_docsdir;
open(IN, "< $file") || return 0;
while (<IN>) {
if ($_ =~ /[ \t]+\n?$/) {
@ -603,6 +604,7 @@ sub checkplist {
&perror("WARN: $file [$.]: use \%\%SITE_PERL\%\% ".
"instead of lib/perl5/site_perl/\%\%PERL_VER\%\%.");
}
$seen_dirrm_docsdir++ if /^(\%\%PORTDOCS\%\%)?\@dirrm\s+\%\%DOCSDIR\%\%/;
if ($_ =~ /^\@/) {
if ($_ =~ /^\@(cwd|cd)[ \t]+(\S+)/) {
$curdir = $2;
@ -766,6 +768,10 @@ sub checkplist {
}
}
if ($sharedocused && !$seen_dirrm_docsdir) {
&perror("WARN: $file: \%\%PORTDOCS\%\%\@dirrm \%\%DOCSDIR\%\% is missing");
}
# Check that each OMF file has an install and deinstall line.
my $omf_install = join(" ", @exec_omf);
$omf_install .= ' ';
@ -1027,6 +1033,18 @@ sub checkmakefile {
}
}
#
# whole file: PLIST_FILES and PLIST_DIRS
#
print "OK: checking PLIST_FILES and PLIST_DIRS.\n" if ($verbose);
if ($whole =~ /\nPLIST_FILES.?=/ || $whole =~ /\nPLIST_DIRS.?=/) {
if (-f 'pkg-plist') {
my $lineno = &linenumber($`);
&perror("WARN: $file [$lineno]: You may remove pkg-plist ".
"if you use PLIST_FILES and/or PLIST_DIRS.");
}
}
#
# whole file: USE_* used too late
#
@ -1847,6 +1865,20 @@ FETCH_DEPENDS DEPENDS DEPENDS_TARGET
"USE_PERL5.");
}
# check USE_ICONV
if ($m{'dep'} =~ /^(iconv\.\d+)$/) {
&perror("WARN: $file: dependency to $1 ".
"listed in $j. consider using ".
"USE_ICONV.");
}
# check USE_GETTEXT
if ($m{'dep'} =~ /^(intl\.\d+)$/) {
&perror("WARN: $file: dependency to $1 ".
"listed in $j. consider using ".
"USE_GETTEXT.");
}
# check USE_GMAKE
if ($m{'dep'} =~ /^(gmake|\${GMAKE})$/) {
&perror("WARN: $file: dependency to $1 ".

View File

@ -8,7 +8,7 @@
#
PORTNAME= portlint
PORTVERSION= 2.6.0
PORTVERSION= 2.6.1
CATEGORIES= devel
MASTER_SITES= # none
DISTFILES= # none

View File

@ -17,7 +17,7 @@
# OpenBSD and NetBSD will be accepted.
#
# $FreeBSD$
# $Id: portlint.pl,v 1.44 2004/03/26 20:42:32 marcus Exp $
# $Id: portlint.pl,v 1.46 2004/05/01 02:22:20 marcus Exp $
#
use vars qw/ $opt_a $opt_A $opt_b $opt_c $opt_h $opt_t $opt_v $opt_M $opt_N $opt_B $opt_V /;
@ -40,7 +40,7 @@ $portdir = '.';
# version variables
my $major = 2;
my $minor = 6;
my $micro = 0;
my $micro = 1;
sub l { '[{(]'; }
sub r { '[)}]'; }
@ -250,12 +250,11 @@ close(IN);
#
# check for files.
#
my @checker = ($makevar{DESCR}, 'Makefile', 'distinfo', $makevar{MD5_FILE});
my @checker = ($makevar{DESCR}, 'Makefile', $makevar{MD5_FILE});
my %checker = (
$makevar{DESCR} => 'checkdescr',
'Makefile' => 'checkmakefile',
$makevar{MD5_FILE} => 'TRUE',
'distinfo' => 'checkdistinfo',
$makevar{MD5_FILE} => 'checkdistinfo',
);
if ($extrafile) {
my @files = (
@ -584,6 +583,8 @@ sub checkplist {
my(@omffile) = ();
my(@infofile) = ();
my $seen_dirrm_docsdir;
open(IN, "< $file") || return 0;
while (<IN>) {
if ($_ =~ /[ \t]+\n?$/) {
@ -603,6 +604,7 @@ sub checkplist {
&perror("WARN: $file [$.]: use \%\%SITE_PERL\%\% ".
"instead of lib/perl5/site_perl/\%\%PERL_VER\%\%.");
}
$seen_dirrm_docsdir++ if /^(\%\%PORTDOCS\%\%)?\@dirrm\s+\%\%DOCSDIR\%\%/;
if ($_ =~ /^\@/) {
if ($_ =~ /^\@(cwd|cd)[ \t]+(\S+)/) {
$curdir = $2;
@ -766,6 +768,10 @@ sub checkplist {
}
}
if ($sharedocused && !$seen_dirrm_docsdir) {
&perror("WARN: $file: \%\%PORTDOCS\%\%\@dirrm \%\%DOCSDIR\%\% is missing");
}
# Check that each OMF file has an install and deinstall line.
my $omf_install = join(" ", @exec_omf);
$omf_install .= ' ';
@ -1027,6 +1033,18 @@ sub checkmakefile {
}
}
#
# whole file: PLIST_FILES and PLIST_DIRS
#
print "OK: checking PLIST_FILES and PLIST_DIRS.\n" if ($verbose);
if ($whole =~ /\nPLIST_FILES.?=/ || $whole =~ /\nPLIST_DIRS.?=/) {
if (-f 'pkg-plist') {
my $lineno = &linenumber($`);
&perror("WARN: $file [$lineno]: You may remove pkg-plist ".
"if you use PLIST_FILES and/or PLIST_DIRS.");
}
}
#
# whole file: USE_* used too late
#
@ -1847,6 +1865,20 @@ FETCH_DEPENDS DEPENDS DEPENDS_TARGET
"USE_PERL5.");
}
# check USE_ICONV
if ($m{'dep'} =~ /^(iconv\.\d+)$/) {
&perror("WARN: $file: dependency to $1 ".
"listed in $j. consider using ".
"USE_ICONV.");
}
# check USE_GETTEXT
if ($m{'dep'} =~ /^(intl\.\d+)$/) {
&perror("WARN: $file: dependency to $1 ".
"listed in $j. consider using ".
"USE_GETTEXT.");
}
# check USE_GMAKE
if ($m{'dep'} =~ /^(gmake|\${GMAKE})$/) {
&perror("WARN: $file: dependency to $1 ".