[Midnightbsd-cvs] mports [19071] trunk/ports-mgmt/portlint: update portlint
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat May 23 11:55:29 EDT 2015
Revision: 19071
http://svnweb.midnightbsd.org/mports/?rev=19071
Author: laffer1
Date: 2015-05-23 11:55:29 -0400 (Sat, 23 May 2015)
Log Message:
-----------
update portlint
Modified Paths:
--------------
trunk/ports-mgmt/portlint/Makefile
trunk/ports-mgmt/portlint/src/portlint.pl
Modified: trunk/ports-mgmt/portlint/Makefile
===================================================================
--- trunk/ports-mgmt/portlint/Makefile 2015-05-23 15:34:15 UTC (rev 19070)
+++ trunk/ports-mgmt/portlint/Makefile 2015-05-23 15:55:29 UTC (rev 19071)
@@ -1,9 +1,10 @@
+# Created by: Jun-ichiro itojun Hagino <itojun at itojun.org>
# $MidnightBSD$
#
# This port is self contained in the src directory.
PORTNAME= portlint
-PORTVERSION= 2.15.4
+PORTVERSION= 2.16.4
CATEGORIES= ports-mgmt
MASTER_SITES= # none
DISTFILES= # none
@@ -11,7 +12,10 @@
MAINTAINER= ports at MidnightBSD.org
COMMENT= Verifier for mports directory
-LICENSE= unknown
+LICENSE= ITOJUN
+LICENSE_NAME= Itojun License
+LICENSE_TEXT= All rights reserved. Freely redistributable. Absolutely no warranty.
+LICENSE_PERMS= auto-accept dist-mirror dist-sell pkg-mirror pkg-sell
NO_BUILD= yes
WRKSRC= ${WRKDIR}/src
@@ -22,28 +26,25 @@
PLIST_FILES= bin/portlint \
man/man1/portlint.1.gz
-.if !defined(NOPORTEXAMPLES)
-PLIST_FILES+= %%EXAMPLESDIR%%/portlintgrep
-PLIST_DIRS= %%EXAMPLESDIR%%
-.endif
+PORTEXAMPLES= portlintgrep
-do-fetch:
- @${DO_NADA}
+OPTIONS_DEFINE= EXAMPLES
pre-patch:
@${CP} -R ${SRC} ${WRKDIR}
post-patch:
- @${REINPLACE_CMD} -e 's|/usr/bin/perl|${PERL}|' ${WRKSRC}/portlint.pl
@${REINPLACE_CMD} -e 's|/usr/bin/perl|${PERL}|' \
+ ${WRKSRC}/portlint.pl \
${WRKSRC}/portlintgrep.pl
do-install:
- ${INSTALL_SCRIPT} ${WRKSRC}/portlint.pl ${TARGETDIR}/bin/portlint
- ${INSTALL_MAN} ${WRKSRC}/portlint.1 ${MAN1PREFIX}/man/man1
-.if !defined(NOPORTEXAMPLES)
- ${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m ${BINMODE} -d ${EXAMPLESDIR}
- ${INSTALL_SCRIPT} ${WRKSRC}/portlintgrep.pl ${EXAMPLESDIR}/portlintgrep
-.endif
+ ${INSTALL_SCRIPT} ${WRKSRC}/portlint.pl \
+ ${PREFIX}/bin/portlint
+ ${INSTALL_MAN} ${WRKSRC}/portlint.1 \
+ ${MAN1PREFIX}/man/man1
+ ${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/portlintgrep.pl \
+ ${EXAMPLESDIR}/portlintgrep
.include <bsd.port.mk>
Modified: trunk/ports-mgmt/portlint/src/portlint.pl
===================================================================
--- trunk/ports-mgmt/portlint/src/portlint.pl 2015-05-23 15:34:15 UTC (rev 19070)
+++ trunk/ports-mgmt/portlint/src/portlint.pl 2015-05-23 15:55:29 UTC (rev 19071)
@@ -11,10 +11,8 @@
# Freely redistributable. Absolutely no warranty.
#
# Please note that this perl code used to be able to handle (Open|Net|Free)BSD
-# bsd.port.mk. There are significant differences in those so you'll have
-# hard time upgrading this...
-# This code now mainly supports FreeBSD, but patches to update support for
-# OpenBSD and NetBSD will be accepted.
+# bsd.port.mk. There are significant differences in those so non-FreeBSD code
+# was removed.
#
# $MidnightBSD: mports/ports-mgmt/portlint/src/portlint.pl,v 1.11 2013/01/18 03:56:21 laffer1 Exp $
# $FreeBSD: ports/devel/portlint/src/portlint.pl,v 1.91 2006/08/06 22:36:45 marcus Exp $
@@ -30,7 +28,7 @@
use POSIX qw(strftime);
sub perror($$$$);
-our ($opt_a, $opt_A, $opt_b, $opt_C, $opt_c, $opt_g, $opt_h, $opt_m, $opt_t, $opt_v, $opt_M, $opt_N, $opt_B, $opt_V, @ALLOWED_FULL_PATHS, @MASTERSITES_WHITELIST);
+our ($opt_a, $opt_A, $opt_b, $opt_C, $opt_c, $opt_g, $opt_h, $opt_m, $opt_t, $opt_v, $opt_M, $opt_N, $opt_B, $opt_V, @ALLOWED_FULL_PATHS);
my ($err, $warn);
my ($extrafile, $parenwarn, $committer, $verbose, $usetabs, $newport,
@@ -48,33 +46,15 @@
$portdir = '.';
@ALLOWED_FULL_PATHS = qw(/boot/loader.conf /compat/ /dev/null /etc/inetd.conf);
- at MASTERSITES_WHITELIST = qw(googlecode.com nodeload.github.com s3.amazonaws.com);
# version variables
my $major = 2;
-my $minor = 15;
+my $minor = 16;
my $micro = 4;
-sub l { '[{(]'; }
-sub r { '[)}]'; }
-sub s { '[ \t]'; }
-
-my $l = &l;
-my $r = &r;
-my $s = &s;
-
# default setting - for MidnightBSD
my $portsdir = '/usr/mports';
my $rcsidstr = 'MidnightBSD';
-my $multiplist = 0;
-my $ldconfigwithtrue = 0;
-my $rcsidinplist = 0;
-my $mancompress = 1;
-my $manstrict = 0;
-my $newxdef = 1;
-my $automan = 1;
-my $autoinfo = 1;
-my $manchapters = '123456789ln';
my $localbase = '/usr/local';
my $numpitems = 6;
@@ -151,11 +131,6 @@
if ($verbose) {
print "OK: config: portsdir: \"$portsdir\" ".
"rcsidstr: \"$rcsidstr\" ".
- "multiplist: $multiplist ".
- "ldconfigwithtrue: $ldconfigwithtrue ".
- "rcsidinplist: $rcsidinplist ".
- "mancompress: $mancompress ".
- "manstrict: $manstrict ".
"localbase: $localbase ".
"\n";
}
@@ -179,10 +154,10 @@
PKGDIR COMMENT DESCR PLIST PKGCATEGORY PKGINSTALL PKGDEINSTALL
PKGREQ PKGMESSAGE DISTINFO_FILE .CURDIR USE_LDCONFIG USE_AUTOTOOLS
USE_GNOME USE_PERL5 INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION
- PKGINSTALLVER PLIST_FILES PLIST_DIRS PORTDOCS PORTEXAMPLES
+ PLIST_FILES PLIST_DIRS PORTDOCS PORTEXAMPLES
OPTIONS_DEFINE OPTIONS_RADIO OPTIONS_SINGLE OPTIONS_MULTI
OPTIONS_GROUP OPTIONS_SUB INSTALLS_OMF USE_RC_SUBR USES DIST_SUBDIR
- ALLFILES IGNOREFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS GNU_CONFIGURE
+ ALLFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS GNU_CONFIGURE
CONFIGURE_ARGS MASTER_SITE_SUBDIR LICENSE LICENSE_COMB NO_STAGE
DEVELOPER
);
@@ -200,10 +175,6 @@
# variables for global checks.
#
my $sharedocused = 0;
-my %plistmanall = ();
-my %plistmangz = ();
-my %plistman = ();
-my %manlangs = ();
my %predefined = ();
@@ -242,6 +213,12 @@
close(IN);
+open(MK, 'Makefile') || die "Makefile: $!";
+my @muses = grep($_ = /^USES[?+]?=\s*(.*)/ && $1, <MK>);
+foreach my $muse (@muses) {
+ $makevar{USES} .= " " . $muse;
+}
+
#
# check for files.
#
@@ -260,8 +237,7 @@
foreach my $i (@files) {
next if (! -T $i);
next if (defined $checker{$i});
- if ($i =~ /\bpkg-plist$/
- || ($multiplist && $i =~ /\bpkg-plist/)) {
+ if ($i =~ /\bpkg-plist/) {
unshift(@checker, $i);
$checker{$i} = \&checkplist;
} else {
@@ -298,11 +274,6 @@
}
}
-# Check to make sure there is no pkg-comment file anymore.
-if (-f 'pkg-comment') {
- &perror("FATAL", "", -1, "Use of pkg-comment is obsolete. Use the COMMENT macro within the port's Makefile instead.");
-}
-
if ($committer) {
sub find_proc {
return if /^\.\.?$/;
@@ -324,12 +295,12 @@
"If it still needs to be there, put a dummy comment ".
"to state that the file is intentionally left empty.");
} elsif (-d && scalar(my @x = <$_/{*,.?*}>) <= 1) {
- &perror("FATAL", $fullname, -1, "empty directory should be removed.") unless ($fullname =~ /^\.svn/);
+ &perror("FATAL", $fullname, -1, "empty directory should be removed.") unless ($fullname =~ /^\.svn/ || $fullname =~ /^\.git/);
} elsif (/^\./) {
&perror("WARN", $fullname, -1, "dotfiles are not preferred. ".
"If this file is a dotfile to be installed as an example, ".
"consider importing it as \"dot$_\".") unless
- (-d && $_ eq '.svn');
+ (-d && ($_ eq '.svn' || $_ eq '.git'));
} elsif (/[^-.a-zA-Z0-9_\+]/) {
&perror("WARN", $fullname, -1, "only use characters ".
"[-_.a-zA-Z0-9+] for patch or script names.");
@@ -342,7 +313,7 @@
} elsif (/README.html/) {
&perror("FATAL", $fullname, -1, "for safety, be sure to cleanup ".
"README.html files before committing the port.");
- } elsif ($_ eq '.svn' && -d) {
+ } elsif (($_ eq '.svn' || $_ eq '.git') && -d) {
&perror("FATAL", $fullname, -1, "for safety, be sure to cleanup ".
"Subversion files before committing the port.");
@@ -409,21 +380,13 @@
my($file) = @_;
my($dist_subdir) = $makevar{DIST_SUBDIR};
my(@allfiles) = split (/\s+/, $makevar{ALLFILES});
- my %ignorefiles = ();
my %algorithms = ();
my %records = ();
- foreach my $i (split (/\s+/, $makevar{IGNOREFILES})) {
- $ignorefiles{$i} = 1;
- }
foreach my $i (split (/\s+/, uc ($makevar{CHECKSUM_ALGORITHMS}))) {
$algorithms{$i} = 1;
}
- if (scalar (%ignorefiles)) {
- &perror("WARN", "", -1, "Found IGNOREFILES. It is not recomended.");
- }
-
open(IN, "< $file") || return 0;
while (<IN>) {
if (/^\s*$/) {
@@ -452,7 +415,7 @@
my $path = $f;
$path = "$dist_subdir/$f" if $dist_subdir;
- if (!defined($records{$path}{SIZE}) && !$ignorefiles{$f}) {
+ if (!defined($records{$path}{SIZE})) {
&perror("FATAL", $file, -1, "has no SIZE record for $path.");
}
my $n = 0;
@@ -565,16 +528,8 @@
sub checkplist {
my($file) = @_;
my($curdir) = ($localbase);
- my($inforemoveseen, $infoinstallseen, $infoseen) = (0, 0, 0);
- my($infobeforeremove, $infoafterinstall) = (0, 0);
- my($infooverwrite) = (0);
my($rcsidseen) = (0);
- my(@exec_info) = ();
- my(@unexec_info) = ();
- my(@infofile) = ();
-
- my $seen_dirrm_docsdir = 0;
my $seen_special = 0;
my $item_count = 0;
@@ -603,6 +558,10 @@
$_ =~ s/\s+$//;
$_ =~ s/\n$//;
+ if ($_ eq "") {
+ &perror("WARN", $file, $., "empty line found in plist.");
+ }
+
# store possible OPTIONS knobs for OPTIONS_SUB
if ($makevar{OPTIONS_SUB}) {
while (/\%\%([^%]+)\%\%/g) {
@@ -637,8 +596,24 @@
"removed. It is listed in BSD.local.dist.");
}
+ if (m'\@dirrm(try)?\s') {
+ &perror("WARN", $file, $., "\@dirrm[try] is deprecated. If you ".
+ "require special directory handling, use \@dir instead and ".
+ "consult the porter's handbook.");
+ }
+
+ if (m'\@cwd') {
+ &perror("WARN", $file, $., "\@cwd is deprecated. Please use ".
+ "absolute pathnames instead.");
+ }
+
+ if (m'\@stopdaemon\s') {
+ &perror("WARN", $file, $., "\@stopdaemon is deprecated. The ".
+ "pkg(8) has a generic mechanism to provide the same function, ".
+ "see HANDLE_RC_SCRIPTS in pkg.conf(5).");
+ }
+
$seen_special++ if /[\%\@]/;
- $seen_dirrm_docsdir++ if /^(\%\%PORTDOCS\%\%)?\@dirrm\s+\%\%DOCSDIR\%\%/ || /^(\%\%PORTDOCS\%\%)?\@unexec\s+(\/bin\/)?rmdir\s+\%D\/\%\%DOCSDIR\%\%\s+2\>\s*\/dev\/null\s+\|\|\s+(\/usr\/bin\/)?true/;
if ($_ =~ /^\@/) {
if ($_ =~ /^\@(cwd|cd)[ \t]+(\S+)/) {
$curdir = $2;
@@ -659,26 +634,14 @@
}
&perror("WARN", $file, $., "use \"\@dirrmtry\" ".
"instead of \"\@unexec rmdir\".");
- } elsif (!$autoinfo && $_ =~ /^\@exec[ \t]+install-info\s+(.+)\s+(.+)$/) {
- $infoinstallseen = $.;
- push(@exec_info, $1);
- } elsif (!$autoinfo && $_ =~ /^\@unexec[ \t]+install-info[ \t]+--delete\s+(.+)\s+(.+)$/) {
- $inforemoveseen = $.;
- push(@unexec_info, $1);
- } elsif ($autoinfo && $_ =~ /^\@unexec[ \t]+install-info[ \t]+--delete\s+(.+)\s+(.+)$/) {
+ } elsif ($_ =~ /^\@unexec[ \t]+install-info[ \t]+--delete\s+(.+)\s+(.+)$/) {
&perror("WARN", $file, $., "\@unexec install-info is deprecated in favor of adding info files into the Makefile using the INFO macro.");
} elsif ($_ =~ /^\@(exec|unexec)/) {
if (/ldconfig/) {
- if ($ldconfigwithtrue
- && !/\/usr\/bin\/true/) {
- &perror("FATAL", $file, $., "ldconfig ".
- "must be used with ".
- "\"||/usr/bin/true\".");
- }
- &perror("WARN", $file, $., "possible ".
- "direct use of ldconfig ".
- "in PLIST found. use ".
- "USE_LDCONFIG instead.");
+ &perror("WARN", $file, $., "possible ".
+ "direct use of ldconfig ".
+ "in PLIST found. use ".
+ "USE_LDCONFIG instead.");
}
if (/scrollkeeper/) {
&perror("WARN", $file, $., "possible ".
@@ -690,17 +653,11 @@
}
} elsif ($_ =~ /^\@(comment)/) {
$rcsidseen++ if (/\$$rcsidstr[:\$]/);
- } elsif ($_ =~ /^\@(owner|group|mode)\s/) {
- if ($makevar{NO_STAGE}) {
- &perror("WARN", $file, $., "\@$1 should not be needed");
- }
} elsif ($_ =~ m!^\@(dirrm|dirrmtry)\s+/!) {
&perror("WARN", $file, $., "Using \@$1 with absolute path ".
"will not work as you expected in most cases. Use ".
- "pkg-deinstall or \@unexec rmdir ... if you want to ".
- "remove a directory such as /var/\${PORTNAME}");
- } elsif ($_ =~ /^\@(dirrm|option|stopdaemon|rmtry)/) {
- ; # no check made
+ "\@dir... if you want to remove a directory such as ".
+ "/var/\${PORTNAME}");
} elsif ($_ eq "\@cwd") {
; # @cwd by itself means change directory back to the original
# PREFIX.
@@ -711,6 +668,8 @@
" file that does not end in ``.sample''. Sample".
" files must end in ``.sample''.");
}
+ } elsif ($_ =~ /^\@(dir|dirrm|dirrmtry|rmtry|option|stopdaemon|owner|group|mode|fc|fcfontsdir|fontsdir|info|shell)\b/) {
+ ; # no check made
} else {
&perror("WARN", $file, $.,
"unknown pkg-plist directive \"$_\"");
@@ -718,11 +677,6 @@
next;
}
- if ($_ =~ /^\//) {
- &perror("FATAL", $file, $., "use of full pathname ".
- "disallowed.");
- }
-
if ($_ =~ /charset\.alias$/ || $_ =~ /locale\.alias$/) {
&perror("WARN", $file, $., "installing charset.alias or locale.alias, ".
"please add USES[+]=gettext and use libintl from devel/gettext ".
@@ -784,30 +738,14 @@
"If possible, install this file with a different name.");
}
- if ($autoinfo && $_ =~ /\.info$/) {
+ if ($_ =~ /\.info$/) {
&perror("WARN", $file, $., "enumerating info files in the plist is deprecated in favor of adding info files into the Makefile using the INFO macro.");
}
- if ($autoinfo && $_ =~ /\.info-\d+$/) {
+ if ($_ =~ /\.info-\d+$/) {
&perror("FATAL", $file, $., "numbered info files are obsolete and not portable; add info files using the INFO macro in the Makefile.");
}
- if (!$autoinfo) {
- if ($_ =~ /^info\/.*info(-[0-9]+)?$/) {
- $infoseen = $.;
- $infoafterinstall++ if ($infoinstallseen);
- $infobeforeremove++ if (!$inforemoveseen);
- push(@infofile, $_);
- }
-
- if ($_ =~ /^info\/dir$/) {
- &perror("FATAL", $file, $., "\"info/dir\" should not be listed.".
- "Use install-info to add/remove ".
- "an entry.");
- $infooverwrite++;
- }
- }
-
if ($_ =~ /^(\%\%PORTDOCS\%\%)?share\/doc\//) {
&perror("WARN", $file, $., "If and only if your port is ".
"DOCSDIR-safe (that is, a user can override DOCSDIR ".
@@ -848,31 +786,14 @@
"accordingly.") unless ($check_xxxdir_ok{$3} eq $1);
}
- if ($_ =~ m#man/([^/]+/)?man([$manchapters])/([^\.]+\.[$manchapters])(\.gz)?$#) {
- if (!$4) {
- $plistman{$2} .= ' ' . $3;
- if ($mancompress) {
- &perror("FATAL", $file, $.,
- "unpacked man file $3 ".
- "listed. must be gzipped.");
- }
- } else {
- $plistmangz{$2} .= ' ' . $3;
- if (!$mancompress) {
- &perror("FATAL", $file, $.,
- "gzipped man file $3$4 ".
- "listed. unpacked one should ".
- "be installed.");
- }
+ if ($_ =~ m#man/([^/]+/)?man[1-9ln]/([^\.]+\.[1-9ln])(\.gz)?$#) {
+ if (!$3) {
+ &perror("FATAL", $file, $., "Unpacked man file $2 listed. ".
+ "Must be gzipped.");
}
- $plistmanall{$2} .= ' ' . $3;
- if ($1) {
- $manlangs{substr($1, 0, length($1) - 1)}++;
- }
}
- if ($curdir !~ m#^$localbase#
- && $curdir !~ m#^/usr/X11R6#) {
+ if ($curdir !~ m#^$localbase#) {
&perror("WARN", $file, $., "installing to ".
"directory $curdir discouraged. ".
"could you please avoid it?");
@@ -887,65 +808,10 @@
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.");
-}
-
- if ($sharedocused && !$seen_dirrm_docsdir) {
- &perror("WARN", $file, -1, "Both ``\%\%PORTDOCS\%\%\@dirrm \%\%DOCSDIR\%\%'' and ``\%\%PORTDOCS\%\%\@unexec \%D/\%\%DOCSDIR\%\% 2>/dev/null || true'' are missing. At least one should be used.");
}
- if (!$autoinfo) {
-# check that every infofile has an exec install-info and unexec install-info
- 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-/);
- if ($exec_install !~ m/\%D\/\Q$if\E/) {
- &perror("FATAL", $file, -1, "you need an '\@exec install-info \%D/$if \%D/info/dir' line");
- }
- if ($unexec_install !~ m/\%D\/$if/) {
- &perror("FATAL", $file, -1, "you need an '\@unexec install-info --delete \%D/$if \%D/info/dir' line");
- }
- }
- }
-
- if ($rcsidinplist && !$rcsidseen) {
- &perror("FATAL", $file, -1, "RCS tag \"\$$rcsidstr\$\" must be present ".
- "as \@comment.")
- }
-
- if (((!$autoinfo && !$infoseen) || $autoinfo)) {
- close(IN);
- return 1;
- }
-
- if (!$autoinfo && $infoseen) {
- if (!$infoinstallseen) {
- if ($infooverwrite) {
- &perror("FATAL", $file, -1, "install-info must be used to ".
- "add/delete entries into \"info/dir\".");
- }
- &perror("FATAL", $file, -1, "\"\@exec install-info \%D/... \%D/info/dir\" must be placed ".
- "after all the info files.");
- } elsif ($infoafterinstall) {
- &perror("FATAL", $file, $infoinstallseen, "move ".
- "\"\@exec install-info\" line to make ".
- "sure that it is placed after all the info files.");
- }
- if (!$inforemoveseen) {
- &perror("FATAL", $file, -1, "\"\@unexec install-info --delete \%D/... \%D/info/dir\" must ".
- "be placed before any of the info files listed.");
- } elsif ($infobeforeremove) {
- &perror("FATAL", $file, $inforemoveseen, "move ".
- "\"\@exec install-info --delete\" ".
- "line to make sure ".
- "that it is placed before any of the info files. ");
- }
- }
-
close(IN);
+ 1;
}
#
# ${PORTSDIR}/MOVED, UIDs, GIDs files
@@ -1061,6 +927,13 @@
$whole = '';
while (<IN>) {
$whole .= $_;
+ if (/^--- /) {
+ if ($_ !~ /UTC\s*$/) {
+ &perror("WARN", $file, -1, "patch was not generated using ".
+ "``make makepatch''. It is recommended to use ".
+ "``make makepatch'' to ensure proper patch format.");
+ }
+ }
}
if ($committer && $whole =~ /\wjavavm\w/) {
@@ -1134,11 +1007,11 @@
"dir=\"$m{'dir'}\", tgt=\"$m{'tgt'}\"\n"
if ($verbose);
- # check USE_PERL5
+ # check USES=perl5
if ($m{'dep'} =~ /^perl5(\.\d+)?$/) {
&perror("WARN", $file, -1, "dependency to perl5 ".
"listed in $j. consider using ".
- "USE_PERL5.");
+ "USES[+]=perl5.");
}
# Check for ${SITE_PERL} in depends
@@ -1149,11 +1022,11 @@
" for more details.");
}
- # check USE_ICONV
+ # check USES=iconv
if ($m{'dep'} =~ /^(iconv\.\d+)$/) {
&perror("WARN", $file, -1, "dependency to $1 ".
"listed in $j. consider using ".
- "USE_ICONV.");
+ "USES[+]=iconv.");
}
# check USES=gettext
@@ -1164,7 +1037,7 @@
}
# check USES=gmake
- if ($m{'dep'} =~ /^(gmake|\${MAKE_CMD})$/) {
+ if ($m{'dep'} =~ /^(gmake|\${GMAKE})$/) {
&perror("WARN", $file, -1, "dependency to $1 ".
"listed in $j. consider using ".
"USES[+]=gmake.");
@@ -1391,11 +1264,62 @@
print "OK: checking for use of .elseif.\n" if ($verbose);
if ($whole =~ /^\.\s*else\s*if/m) {
my $lineno = &linenumber($`);
- &perror("FATAL", $file, $lineno, "use of .elseif (or .else if) is not
- supported in all versions of FreeBSD. Use .elif instead.");
+ &perror("FATAL", $file, $lineno, "use of .elseif (or .else if) is not ".
+ "supported in all versions of BSD. Use .elif instead.");
}
#
+ # whole file: use of @${INSTALL_foo}
+ #
+ print "OK: checking for use of muted INSTALL_ commands.\n" if ($verbose);
+ if ($whole =~ /^\s+\@\$\{INSTALL_/m) {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "do not use muted INSTALL_foo ".
+ "commands (i.e., those that start with '\@'). These should be ".
+ "printed.");
+ }
+
+ #
+ # checking for use of ${ENV}
+ #
+ print "OK: checking for use of \${ENV} instead of \${SETENV}.\n" if ($verbose);
+ if ($whole =~ /\$\{ENV}/m) {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "most uses of \${ENV} should really ".
+ "be \${SETENV} to avoid strange behaviors in sh(1).");
+ }
+
+ #
+ # whole file: use of :LU variable expansion modifiers
+ #
+ print "OK: checking for use of :LU variable expansion modifiers.\n" if ($verbose);
+ if ($whole =~ /\$\{[^}]+:[LU]/m) {
+ my $lineno = &linenumber($`);
+ &perror("FATAL", $file, $lineno, ":U and :L syntax is not supported ".
+ "anymore. Please use :tu and :tl instead.");
+ }
+
+ #
+ # whole file: use of IGNOREFILES
+ #
+ print "OK: checking for use of IGNOREFILES.\n" if ($verbose);
+ if ($whole =~ /\nIGNOREFILES.?=/m) {
+ my $lineno = &linenumber($`);
+ &perror("FATAL", $file, $lineno, "IGNOREFILES considered unsafe and ".
+ "not supported anymore.");
+ }
+
+ #
+ # whole file: use of PLIST_DIRSTRY
+ #
+ print "OK: checking for use of PLIST_DIRSTRY.\n" if ($verbose);
+ if ($whole =~ /\nPLIST_DIRSTRY.?=/m) {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "PLIST_DIRSTRY is deprecated. Please ".
+ "use PLIST_DIRS instead.");
+ }
+
+ #
# whole file: PLIST_FILES and PLIST_DIRS
#
print "OK: checking PLIST_FILES and PLIST_DIRS.\n" if ($verbose);
@@ -1516,7 +1440,7 @@
while ($whole =~ /PORT_OPTIONS:M(\w+)/mg) {
push @mopt, $1;
my $lineno = &linenumber($`) + 1;
- &perror("FATAL", $file, $lineno, "option WITH(OUT)_$1 is used before ".
+ &perror("FATAL", $file, $lineno, "PORT_OPTIONS:M$1 is used before ".
"including bsd.port.pre.mk or bsd.port.options.mk.")
if ($optused && $lineno < $pre_mk_line &&
$lineno < $options_mk_line);
@@ -1584,7 +1508,7 @@
}
foreach my $i ((@opt, @aopt)) {
# skip global options
- next if ($i eq 'DOCS' or $i eq 'NLS' or $i eq 'EXAMPLES' or $i eq 'IPV6' or $i eq 'X11');
+ next if ($i eq 'DOCS' or $i eq 'NLS' or $i eq 'EXAMPLES' or $i eq 'IPV6' or $i eq 'X11' or $i eq 'DEBUG');
if (!grep(/^$i$/, (@mopt, @popt))) {
if ($whole !~ /\n${i}_($m)(.)?=[^\n]+/) {
&perror("WARN", $file, -1, "$i is listed in ".
@@ -1612,25 +1536,6 @@
&perror("FATAL", $file, -1, "Use true/false (without quotes) instead of \${TRUE}/\${FALSE} in DESKTOP_ENTRIES.");
}
- my @dte_parts = split(/\s+/, $desktop_entries);
- my $dtc = 0;
- my $dte_quote = 0;
- foreach my $dte_part (@dte_parts) {
- if ($dtc % 5 == 0 && $dte_part eq '""') {
- &perror("FATAL", $file, -1, "Use true/false (without quotes) instead of \${TRUE}/\${FALSE} in DESKTOP_ENTRIES.");
- }
- if ($dte_quote == 1 && $dte_part =~ /"$/) {
- $dte_quote = 0;
- }
- if ($dte_part =~ /^"[^"]+$/) {
- $dte_quote = 1;
- next;
- }
- if (!$dte_quote) {
- $dtc++;
- }
- }
-
#
# whole file: USE_* as a user-settable option
#
@@ -1656,16 +1561,6 @@
}
#
- # whole file: USE_SIZE
- #
- print "OK: checking USE_SIZE.\n" if ($verbose);
- if ($whole =~ /\nUSE_SIZE/) {
- my $lineno = &linenumber($`);
- &perror("WARN", $file, $lineno, "use of USE_SIZE is no longer ".
- "required.");
- }
-
- #
# whole file: MACHINE_ARCH
#
print "OK: checking MACHINE_ARCH.\n" if ($verbose);
@@ -1704,6 +1599,11 @@
}
}
+ if ($makevar{COMMENT} =~ /^An? / || $makevar{COMMENT} =~ /^The /) {
+ &perror("WARN", $file, -1, "COMMENT is not supposed to begin with ".
+ "'A ', 'An ', or 'The '.");
+ }
+
if ($whole =~ /\nIGNORE[+?]?=[ \t]+[^a-z \t]/ ||
$whole =~ /^IGNORE[+?]?=[ \t]+.*\.$/m) {
my $lineno = &linenumber($`);
@@ -1736,6 +1636,20 @@
}
#
+ # whole file: Check if USES is sorted
+ #
+ print "OK: checking to see if USES is sorted.\n" if ($verbose);
+ while ($whole =~ /\nUSES.=\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 USES are not ".
+ "sorted. Please consider sorting them.");
+ }
+ }
+
+ #
# whole file: USE_GNOME=pkgconfig
#
print "OK: checking for USE_GNOME=pkgconfig.\n" if ($verbose);
@@ -1782,17 +1696,27 @@
$docsused++;
}
print "OK: checking for use of NOPORTDOCS.\n" if ($verbose);
- if ($whole =~ /NOPORTSDOC/) {
+ if ($whole =~ /defined\s*\(?NOPORTDOCS\)?/ ||
+ $whole =~ /def\s*\(?NOPORTDOCS\)?/) {
my $lineno = &linenumber($`);
- &perror("WARN", $file, $lineno, "NOPORTSDOC found. Do you ".
- "mean NOPORTDOCS?");
+ &perror("WARN", $file, $lineno, "NOPORTDOCS is deprecated. Please ".
+ "use PORT_OPTIONS:MDOCS instead.");
}
+ print "OK: checking for use of NOPORTEXAMPLES.\n" if ($verbose);
+ if ($whole =~ /defined\s*\(?NOPORTEXAMPLES\)?/ ||
+ $whole =~ /def\s*\(?NOPORTEXAMPLES\)?/) {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "NOPORTEXAMPLES is deprecated. Please ".
+ "use PORT_OPTIONS:MEXAMPLES instead.");
+ }
if ($sharedocused && $whole !~ /defined\s*\(?NOPORTDOCS\)?/
&& $whole !~ /def\s*\(?NOPORTDOCS\)?/) {
- if ($makevar{NO_STAGE} && $docsused == 0
+ if ($docsused == 1
&& $whole !~ m#(\$[\{\(]PREFIX[\}\)]|$localbase)/share/doc/#) {
- &perror("WARN", $file, -1, "use \".if \${PORT_OPTIONS:MDOCS}\" to wrap ".
- "installation of files into $localbase/share/doc.");
+ &perror("WARN", $file, -1, "you should only use \".if \${PORT_OPTIONS:MDOCS}\" to wrap ".
+ "installation of files into $localbase/share/doc if the".
+ " collection of files is large and it takes considerable time".
+ " to copy.");
}
} else {
$docsused++;
@@ -1851,7 +1775,7 @@
/ || $whole =~ /:cntrl:/) {
my $lineno = &linenumber($`);
&perror("WARN", $file, $lineno, "Possible manual removal of DOS ".
- "line endings found. Consider defining USE_DOS2UNIX instead.");
+ "line endings found. Consider defining USES=dos2unix instead.");
}
#
@@ -1862,8 +1786,8 @@
foreach my $i (qw(
awk basename brandelf cat chmod chown cp cpio dialog dirname egrep expr
false file find gmake grep gzcat ldconfig ln md5 mkdir mv objcopy paste patch
-pax perl printf rm rmdir pkg_add pkg_delete pkg_info pkg_version
-ruby sed sdl-config sh sort sysctl touch tr which xargs xmkmf
+pax perl printf rm rmdir ruby sed sdl-config sh sort sysctl touch tr which
+xargs xmkmf
)) {
$cmdnames{$i} = "\$\{\U$i\E\}";
}
@@ -1914,8 +1838,10 @@
&& $curline !~ /^WX_COMPS(.)?=[^\n]+$i/m
&& $curline !~ /^ONLY_FOR_ARCHS_REASON(.)?=[^\n]+$i/m
&& $curline !~ /^NOT_FOR_ARCHS_REASON(.)?=[^\n]+$i/m
+ && $curline !~ /^SHEBANG_FILES(.)?=[^\n]+$i/m
&& $curline !~ /^[A-Z0-9_]+_DESC=[^\n]+$i/m
&& $curline !~ /^\s*#.+$/m
+ && $curline !~ /\$\{MAKE_CMD\}.*\binstall\b/m
&& $curline !~ /\-\-$i/m
&& $curline !~ /^COMMENT(.)?=[^\n]+$i/m) {
&perror("WARN", $file, $lineno, "possible direct use of ".
@@ -1941,6 +1867,8 @@
&& $lm !~ /^MAINTAINER(.)?=[^\n]+($i\d*)/m
&& $lm !~ /^CATEGORIES(.)?=[^\n]+($i\d*)/m
&& $lm !~ /^USES(.)?=[^\n]+$i/m
+ && $lm !~ /^[A-Z0-9_]+_DESC=[^\n]+($i\d*)/m
+ && $lm !~ /^SHEBANG_FILES(.)?=[^\n]+($i\d*)/m
&& $lm !~ /^USE_AUTOTOOLS(.)?=[^\n]+($i\d*)/m
&& $lm !~ /^\s*#.+$/m
&& $lm !~ /^COMMENT(.)?=[^\n]+($i\d*)/m) {
@@ -1973,19 +1901,6 @@
}
#
- # whole file: ldconfig must come with "true" command
- #
- print "OK: checking that ldconfig is properly checked.\n"
- if ($verbose);
- if ($ldconfigwithtrue
- && $j =~ /(ldconfig|\$[{(]LDCONFIG[)}])/
- && $j !~ /(\/usr\/bin\/true|\$[{(]TRUE[)}])/) {
- my $lineno = &linenumber($`);
- &perror("FATAL", $file, $lineno, "ldconfig must be used with ".
- "\"||\${TRUE}\".");
- }
-
- #
# whole file: ${GZIP_CMD} -9 (or any other number)
#
print "OK: checking for compression arguments passed to \${GZIP_CMD}.\n"
@@ -1997,30 +1912,29 @@
"sets the compression level.");
}
- if (!$makevar{NO_STAGE}) {
- #
- # whole file: ${CHMOD} used
- #
- print "OK: checking for \${CHMOD}.\n"
- if ($verbose);
- if ($j =~ /\n\s*\${CHMOD}/) {
- my $lineno = &linenumber($`);
- &perror("WARN", $file, $lineno, "possible use of \"\${CHMOD}\" ".
- "found. Use \@owner/\@group operators in pkg-plist instead.");
- }
- #
- # whole file: ${INSTALL} -o | -g used
- #
- print "OK: checking for \${INSTALL} -o | -g.\n"
- if ($verbose);
- if ($j =~ /\n\s*\${INSTALL}(.*-\b(o|g)\b.*)/) {
- my $lineno = &linenumber($`);
- &perror("WARN", $file, $lineno, "possible use of \"\${INSTALL} -o | -g\" ".
- "found. Use \@owner/\@group operators in pkg-plist instead.");
- }
+ #
+ # whole file: ${CHMOD} used
+ #
+ print "OK: checking for \${CHMOD}.\n" if ($verbose);
+ if ($j =~ /\n\s*\${CHMOD}/) {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "possible use of \"\${CHMOD}\" ".
+ "found. Use @(owner,group,mode) syntax or \@owner/\@group ".
+ "operators in pkg-plist instead.");
}
#
+ # whole file: ${INSTALL} -o | -g used
+ #
+ print "OK: checking for \${INSTALL} -o | -g.\n" if ($verbose);
+ if ($j =~ /\n\s*\${INSTALL}(.*-\b(o|g)\b.*)/) {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "possible use of \"\${INSTALL} -o | -g\" ".
+ "found. Use @(owner,group,mode) syntax or \@owner/\@group ".
+ "operators in pkg-plist instead.");
+ }
+
+ #
# whole file: ${MKDIR} -p
#
print "OK: checking for \${MKDIR} -p.\n"
@@ -2075,11 +1989,31 @@
#
if ($j =~ m'\${(?:LOCALBASE|PREFIX)}/lib/perl5/site_perl/\${PERL_VER}') {
my $lineno = &linenumber($`);
- &perror("WARN", $file, $lineno, "possible use of \"\${LOCALBASE}/lib/perl5/site_perl/\${PERL_VER}\" ".
- "found. use \"\${SITE_PERL}\" instead.");
+ if ($1 !~ /PREFIX/) {
+ &perror("WARN", $file, $lineno, "possible use of \"\${LOCALBASE}/lib/perl5/site_perl\" ".
+ "found. use \"\${SITE_PERL}\" instead.");
+ } else {
+ &perror("WARN", $file, $lineno, "possible use of \"\${PREFIX}/lib/perl5/site_perl\" ".
+ "found. use \"\${PREFIX}/\${SITE_PERL_REL}\" instead.");
+ }
}
#
+ # whole file: check for misuse of FAKE with SITE_PERL and SITE_ARCH
+ #
+ if ($j =~ m'\${FAKE_DESTDIR}\${SITE_PERL}') {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "\${FAKE_DESTDIR}\${SITE_PERL} should be ".
+ "replaced by \${FAKE_DESTDIR}\${PREFIX}/\${SITE_PERL_REL}.");
+ }
+
+ if ($j =~ m'\${STAGEDIR}\${SITE_ARCH}') {
+ my $lineno = &linenumber($`);
+ &perror("WARN", $file, $lineno, "\${STAGEDIR}\${SITE_ARCH} should be ".
+ "replaced by \${STAGEDIR}\${PREFIX}/\${SITE_ARCH_REL}.");
+ }
+
+ #
# whole file: USE_GNOME check
#
if ($whole =~ /^USE_GNOME[?:]?=\s*(.*)$/m) {
@@ -2096,15 +2030,7 @@
my $gcc_val = $1;
if ($gcc_val eq 'any' || $gcc_val eq 'yes') {
# Just accept these two.
- } elsif ($gcc_val =~ /3\.[234]\+/) {
- &perror("WARN", $file, $lineno, "USE_GCC=3.2+, USE_GCC=3.3+, ".
- "and USE_GCC=3.4+ are noops on all currently (and future) ".
- "supported versions of FreeBSD. Do not use them.");
- } elsif ($gcc_val eq "4.1+") {
- &perror("WARN", $file, $lineno, "USE_GCC=4.2+ is recommended ".
- "over USE_GCC=4.1+ since the former is the system compiler ".
- "for FreeBSD 7.X.");
- } elsif ($gcc_val !~ /\+/ && $gcc_val ne 'any') {
+ } elsif ($gcc_val !~ /\+/) {
&perror("WARN", $file, $lineno, "Setting a specific version for ".
"USE_GCC should only be done as a last resort. Unless you ".
"have confirmed this port does not build with later ".
@@ -2139,11 +2065,11 @@
}
#
- # whole file: check for USE_ANT and USE_MAKE_CMD both defined
+ # whole file: check for USE_ANT and USES=gmake both defined
#
- if ($use_ant && $whole =~ /^USE_MAKE_CMD[?:]?=\s*(.*)$/m) {
+ if ($use_ant && $makevar{USES} !~ /\bgmake\b/) {
&perror("WARN", $file, -1, "a port shall not define both USE_ANT ".
- "and USE_MAKE_CMD");
+ "and USES[+]=gmake");
}
#
@@ -2518,14 +2444,12 @@
}
# check x11 in CATEGORIES
- if ($newxdef) {
#MICHAEL: I don't understand this line
- if (2 <= @cat && $cat[1] eq "x11") {
- &perror("WARN", $file, -1, "only specific kind of apps should ".
- "specify \"x11\" in CATEGORIES. ".
- "Do you mean just USE_XORG? ".
- "Then remove \"x11\" from CATEGORIES.");
- }
+ if (2 <= @cat && $cat[1] eq "x11") {
+ &perror("WARN", $file, -1, "only specific kind of apps should ".
+ "specify \"x11\" in CATEGORIES. ".
+ "Do you mean just USE_XORG? ".
+ "Then remove \"x11\" from CATEGORIES.");
}
if (2 <= @cat) {
@@ -2576,8 +2500,6 @@
# check DISTFILES and related items.
$distfiles = $1 if ($tmp =~ /\nDISTFILES[+?]?=[ \t]*([^\n]+)\n/);
- #$portname = $1 if ($tmp =~ /\nPORTNAME[+?]?=[ \t]*([^\n]+)\n/);
- #$portversion = $1 if ($tmp =~ /\nPORTVERSION[+?]?=[ \t]*([^\n]+)\n/);
$portname = $makevar{PORTNAME};
$portversion = $makevar{PORTVERSION};
$distversionprefix = $makevar{DISTVERSIONPREFIX};
@@ -2597,13 +2519,19 @@
&perror("WARN", $file, -1, "EXTRACT_SUFX is \".tar.gz.\" ".
"by default. you don't need to specify it.");
}
- if ($extractsufx eq '.tar.bz2') {
- &perror("WARN", $file, -1, "EXTRACT_SUFX is \".tar.bz2.\" ".
- "You should use USE_BZIP2 instead.");
+ if ($extractsufx =~ /^\.tar\.(bz2|lzma|xz|Z)$/) {
+ my $ext = $1;
+ $ext = 'bzip2' if ($ext eq 'bz2');
+ &perror("WARN", $file, -1, "EXTRACT_SUFX is \".tar.$ext\". ".
+ "Please use USES=tar:$ext instead.");
}
+ if ($extractsufx =~ /^\.(tgz|tbz|txz)$/) {
+ &perror("WARN", $file, -1, "EXTRACT_SUFX is \".$1\". ".
+ "Please use USES=tar:$1 instead.");
+ }
if ($extractsufx eq '.zip') {
&perror("WARN", $file, -1, "EXTRACT_SUFX is \".zip\" ".
- "You should use USE_ZIP instead.");
+ "You should use USES[+]=zip instead.");
}
} else {
print "OK: no EXTRACT_SUFX seen, using default value.\n"
@@ -2673,19 +2601,8 @@
if ($makevar{CONFLICTS}) {
print "OK: checking CONFLICTS.\n" if ($verbose);
foreach my $conflict (split ' ', $makevar{CONFLICTS}) {
- my $selfconflict;
- if ($makevar{PKGINSTALLVER} ne "" &&
- $makevar{PKGINSTALLVER} >= 20040125) {
- $selfconflict = !system($pkg_version, '-T',
- $makevar{PKGNAME}, $conflict);
- } else {
- my $conflictre = $conflict;
- $conflictre =~ s/[.+]/\\$&/g;
- $conflictre =~ s/\*/.*/g;
- $conflictre =~ s/\?/./g;
- $conflictre =~ s/\[!/[^/g;
- $selfconflict = ($makevar{PKGNAME} =~ /^$conflictre$/);
- }
+ `$pkg_version -T '$makevar{PKGNAME}' '$conflict'`;
+ my $selfconflict = !$?;
if ($conflict !~ /(?:[<>=]|[]?*]$)/) {
&perror("WARN", "", -1, "Conflict \"$conflict\" specified too narrow. ".
"You should end it with a wildcard (-[0-9]*).");
@@ -2772,26 +2689,11 @@
}
}
- if ($committer) {
- if (opendir(DIR, ".")) {
- my @tgz = grep(/\.tgz$/, readdir(DIR));
- closedir(DIR);
-
- if (@tgz) {
- my $tgz = (2 <= @tgz)
- ? '{' . join(',', @tgz) . '}'
- : $tgz[0];
-
- &perror("WARN", "", -1, "be sure to remove $portdir/$tgz ".
- "before committing the port.");
- }
- }
- }
-
push(@varnames, qw(
-PORTNAME PORTVERSION PORTREVISION PORTEPOCH CATEGORIES MASTER_SITES
-PKGNAMEPREFIX PKGNAMESUFFIX DISTNAME EXTRACT_SUFX
-DISTFILES EXTRACT_ONLY
+PORTNAME PORTVERSION DISTVERSIONPREFIX DISTVERSION DISTVERSIONSUFFIX
+PORTREVISION PORTEPOCH CATEGORIES MASTER_SITES MASTER_SITE_SUBDIR
+PROJECTHOST PKGNAMEPREFIX PKGNAMESUFFIX DISTNAME EXTRACT_SUFX DISTFILES
+DIST_SUBDIR EXTRACT_ONLY
));
#
@@ -2951,7 +2853,6 @@
"for more details.");
}
- # NOTE: EXEC_DEPENDS is obsolete, so it should not be listed.
@linestocheck = qw(
EXTRACT_DEPENDS LIB_DEPENDS PATCH_DEPENDS BUILD_DEPENDS RUN_DEPENDS
TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET
@@ -3048,15 +2949,9 @@
"ports/LEGAL.");
}
- # check NO_CONFIGURE/NO_PATCH
- print "OK: checking NO_CONFIGURE/NO_PATCH.\n" if ($verbose);
- if ($tmp =~ /\n(NO_CONFIGURE|NO_PATCH)[+?]?=/) {
- &perror("FATAL", $file, -1, "\"$1\" was obsoleted. remove this.");
- }
-
# check NO_STAGE
if ($makevar{NO_STAGE}) {
- &perror("WARN", $file, -1, "Consider adding STAGE support.");
+ &perror("FATAL", $file, -1, "STAGE support is missing.");
}
# various MAN'uals related checks
@@ -3066,95 +2961,15 @@
"\"\${PREFIX}/lib/perl5/\${PERL_VERSION}\" ".
"when USE_PERL5=configure|modbuild|modbuildtiny is set. You do not need to specify it.");
}
- if ($makevar{NO_STAGE}) {
- # check MAN[1-9LN]
- print "OK: checking MAN[0-9LN].\n" if ($verbose);
- foreach my $i (keys %plistmanall) {
- print "OK: pkg-plist MAN$i=$plistmanall{$i}\n" if ($verbose);
- }
- foreach my $i (split(//, $manchapters)) {
- if ($tmp =~ /\nMAN\U$i\E[+?]=\s*([^\n]*)\n/ &&
- (!$makevar{NO_STAGE} || $makevar{NO_STAGE} eq '')) {
- &perror("FATAL", $file, -1, "when STAGE support is enabled ".
- "you must add your man pages directly to the plist ".
- "with a .gz extension.");
- } elsif ($tmp =~ /\nMAN\U$i\E[+?]=\s*([^\n]*)\n/) {
- print "OK: Makefile MAN\U$i\E=$1\n" if ($verbose);
- }
- }
- if ($tmp =~ /\nMANCOMPRESSED=\s*/ &&
- (!$makevar{NO_STAGE} || $makevar{NO_STAGE} eq '')) {
- &perror("WARN", $file, -1, "when STAGE support is enable, the ".
- "MANCOMPRESSED macro is not supported. The compress-man ".
- "target is able to only compress when it is needed.");
- }
- foreach my $i (split(//, $manchapters)) {
- next if ($i eq '');
- my @mansecs = grep(/^MAN\U$i\E=\s*(.*)/, split(/\n/, $tmp));
- if (scalar @mansecs > 1) {
- &perror("FATAL", $file, -1, "duplicate MAN$i macro. ".
- "Only the last MAN$i macro will be processed. Use ".
- "MAN$i+=... instead to append man pages.");
- }
- if ($tmp =~ /^MAN\U$i\E=\s*([^\n]*)\n/) {
- @mman = grep($_ !~ /^\s*$/, split(/\s+/, $1));
- @pman = grep($_ !~ /^\s*$/,
- split(/\s+/, $plistmanall{$i} // ''));
- foreach my $j (@mman) {
- print "OK: checking $j (Makefile)\n"
- if ($verbose);
- if ($automan && grep($_ eq $j, @pman)) {
- &perror("FATAL", $file, -1, "duplicated manpage ".
- "entry $j: content of ".
- "MAN\U$i\E will be automatically ".
- "added to pkg-plist.");
- } elsif (!$automan && !grep($_ eq $j, @pman)) {
- &perror("WARN", $file, -1, "manpage $j ".
- "MAN\U$i\E but not in pkg-plist.");
- }
- }
- foreach my $j (@pman) {
- print "OK: checking $j (pkg-plist)\n" if ($verbose);
- if (!grep($_ eq $j, @mman)) {
- &perror("WARN", $file, -1, "manpage $j in pkg-plist ".
- "but not in MAN\U$i\E.");
- }
- }
- } else {
- if ($plistmanall{$i}) {
- if ($manstrict) {
- &perror("FATAL", $file, -1, "manpage for chapter ".
- "$i must be listed in ".
- "MAN\U$i\E. ");
- } else {
- &perror("WARN", $file, -1, "manpage for chapter ".
- "$i should be listed in ".
- "MAN\U$i\E, ".
- "even if compression is ".
- "not necessary.");
- }
- }
- if ($mancompress && $plistman{$i}) {
- &perror("WARN", $file, -1, "MAN\U$i\E will help you ".
- "compressing manual page in chapter ".
- "\"$i\".");
- } elsif (!$mancompress && $plistmangz{$i}) {
- &perror("WARN", $file, -1, "MAN\U$i\E will help you ".
- "uncompressing manual page in chapter ".
- "\"$i\".");
- }
- }
- }
+
+ if ($tmp =~ /\nMAN[1-9LN][?]?=/) {
+ &perror("FATAL", $file, -1, "MAN[1-9LN] macro is not supported anymore. ".
+ "Please list manpages in plist.");
}
- if ($tmp !~ /MANLANG/ && scalar(keys %manlangs)) {
- $i = (keys %manlangs)[0];
- &perror("WARN", $file, -1, "how about using MANLANG for ".
- "designating manual language, such as \"$i\"?");
- }
# check INFO
print "OK: checking INFO.\n" if ($verbose);
- if ($autoinfo && $tmp =~ /\nINFO=\s*([^\n]*)\n/) {
+ if ($tmp =~ /\nINFO=\s*([^\n]*)\n/) {
my @minfo = grep($_ !~ /^\s*$/, split(/\s+/, $1));
if ($tmp =~ /[\/|\s]install-info\s/) {
&perror("FATAL", $file, -1, "install-info is automatically run ".
@@ -3166,7 +2981,7 @@
"on files listed in the INFO macro.");
}
}
- } elsif ($autoinfo && $tmp =~ /[\/|\s]install-info\s/) {
+ } elsif ($tmp =~ /[\/|\s]install-info\s/) {
&perror("WARN", $file, -1, "do not call install-info directly. Use the ".
"INFO macro instead.");
}
@@ -3232,7 +3047,26 @@
} elsif ($i eq '' && $mvar && $mvar ne '') {
&perror("WARN", $file, -1, "possible undefined make variable ".
"$mvar used as the value for USE_RC_SUBR.");
+ } elsif ($i ne '' && -f "files/$i.in") {
+ if (open(RCIN, "< files/$i.in")) {
+ my @rccontents = <RCIN>;
+ my $found_provide = 0;
+ foreach my $line (@rccontents) {
+ if ($line =~ /^# PROVIDE:/) {
+ $found_provide = 1;
+ last;
+ }
+ }
+ if (!$found_provide) {
+ &perror("FATAL", "files/$i.in", -1, "rc.d script ".
+ "$i.in must contain a '# PROVIDE:' line in ".
+ "order to be started at boot time.");
+ }
+
+ close(RCIN);
+ }
}
+
}
}
}
@@ -3440,7 +3274,21 @@
EOF
foreach my $i (keys %cmdnames) {
# use (?![\w-]) instead of \b to exclude pkg-*
- if ($s =~ /^[^#]*(\.\/|\$[\{\(]\.CURDIR[\}\)]\/|[ \t])(\b$i)(?![\w-])/) {
+ if ($file =~ /^[^#]*(\.\/|\$[\{\(]\.CURDIR[\}\)]\/|[ \t])(\b$i)(?![\w-])/
+ && $s !~ /^COMMENT(.)?=[^\n]+$i/m
+ && $s !~ /^IGNORE(.)?=[^\n]+$i/m
+ && $s !~ /^BROKEN(.)?=[^\n]+$i/m
+ && $s !~ /^RESTRICTED(.)?=[^\n]+$i/m
+ && $s !~ /^NO_PACKAGE(.)?=[^\n]+$i/m
+ && $s !~ /^NO_CDROM(.)?=[^\n]+$i/m
+ && $s !~ /^MAINTAINER(.)?=[^\n]+$i/m
+ && $s !~ /^CATEGORIES(.)?=[^\n]+$i/m
+ && $s !~ /^USES(.)?=[^\n]+$i/m
+ && $s !~ /^WX_COMPS(.)?=[^\n]+$i/m
+ && $s !~ /^SHEBANG_FILES(.)?=[^\n]+$i/m
+ && $s !~ /^[A-Z0-9_]+_DESC=[^\n]+$i/m
+ && $s !~ /^ONLY_FOR_ARCHS_REASON(.)?=[^\n]+$i/m
+ && $s !~ /^NOT_FOR_ARCHS_REASON(.)?=[^\n]+$i/m) {
&perror("WARN", $file, -1, "possible direct use of \"$i\" \"$s\" ".
"found. if so, use $cmdnames{$i}.");
}
@@ -3456,6 +3304,9 @@
chomp $result;
$result =~ s/\n\n/\n\0\n/g;
+ if (${^CHILD_ERROR_NATIVE} != 0) {
+ die "\nFATAL ERROR: make(1) died with status ${^CHILD_ERROR_NATIVE} and returned '$result'";
+ }
return $result;
}
@@ -3468,6 +3319,9 @@
chomp $result;
$result =~ s/\n\n/\n\0\n/g;
+ if (${^CHILD_ERROR_NATIVE} != 0) {
+ die "\nFATAL ERROR: make(1) died with status ${^CHILD_ERROR_NATIVE} and returned '$result'";
+ }
return $result;
}
More information about the Midnightbsd-cvs
mailing list