summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-05-26 07:07:00 +0000
committerrillig <rillig@pkgsrc.org>2005-05-26 07:07:00 +0000
commit95d1b6957c9a310c3f0a788fb1c29c73f3fda246 (patch)
tree93ec1fe5788929ff62c3728842ff934d96c8101f /pkgtools
parent697bd74e7e900002a74aa0183f5c98849b63eeba (diff)
downloadpkgsrc-95d1b6957c9a310c3f0a788fb1c29c73f3fda246.tar.gz
Renamed -Wexpensive to -Wbl3. By default this option is enabled. Added a
subroutine checkfile_buildlink3_mk that performs the basic Makefile checks on buildlink3.mk, if it exists.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl29
1 files changed, 25 insertions, 4 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 76b1d127aca..560a2b11fae 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -11,7 +11,7 @@
# Freely redistributable. Absolutely no warranty.
#
# From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.187 2005/05/26 06:50:09 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.188 2005/05/26 07:07:00 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -300,14 +300,14 @@ my (%options) = (
my $opt_check_distinfo = true;
my $opt_check_extra = true;
-my $opt_check_expensive = false;
+my $opt_check_bl3 = true;
my $opt_check_MESSAGE = true;
my $opt_check_patches = true;
my $opt_check_PLIST = true;
my $opt_check_newpkg = false;
my (%checks) = (
"distinfo" => [\$opt_check_distinfo, "check distinfo file"],
- "expensive" => [\$opt_check_expensive, "enable warnings that may require much time"],
+ "bl3" => [\$opt_check_bl3, "check buildlink3 files"],
"extra" => [\$opt_check_extra, "check various additional files"],
"MESSAGE" => [\$opt_check_MESSAGE, "check MESSAGE files"],
"patches" => [\$opt_check_patches, "check patches"],
@@ -634,6 +634,12 @@ sub check_package() {
log_warning("$opt_packagedir/$distinfo_file", NO_LINE_NUMBER, "File not found. Please run '$conf_make makepatchsum'.");
}
}
+ if ($opt_check_bl3) {
+ foreach my $bl3 ("$opt_packagedir/$pkgdir/buildlink3.mk") {
+ next unless -f $bl3;
+ checkfile_buildlink3_mk($bl3);
+ }
+ }
if ($opt_check_extra) {
foreach my $abs_extra ((<$opt_packagedir/$filesdir/*>, <$opt_packagedir/$pkgdir/*>)) {
my ($extra) = (substr($abs_extra, length("$opt_packagedir/")));
@@ -963,6 +969,21 @@ sub checkfile_PLIST($) {
return true;
}
+sub checkfile_buildlink3_mk($) {
+ my ($file) = @_;
+ my ($fname) = ("$opt_packagedir/$file");
+ my ($lines);
+
+ if (!($lines = load_file($fname))) {
+ log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
+ return false;
+ }
+ checklines_deprecated_variables($lines);
+ checklines_trailing_empty_lines($lines);
+ checklines_direct_tools($lines);
+ return true;
+}
+
sub checkperms($) {
my ($file) = @_;
@@ -1100,7 +1121,7 @@ sub readmakefile($$) {
$contents .= "### pkglint ### skipped $includefile\n";
next;
}
- if (!$opt_check_expensive && $includefile =~ qr"/buildlink3.mk$") {
+ if (!$opt_check_bl3 && $includefile =~ qr"/buildlink3.mk$") {
$contents .= "### pkglint ### skipped $includefile\n";
next;
}