summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2008-08-28 20:38:39 +0000
committerrillig <rillig@pkgsrc.org>2008-08-28 20:38:39 +0000
commit0e2e7b6fb3fa48721286a64cf508110227bda116 (patch)
tree07e3c411d1bc408e94907d9fa8ecd46352ddfe42 /pkgtools/pkglint
parent4ae7eb556e2ee35c7f98142d232931127ff26e46 (diff)
downloadpkgsrc-0e2e7b6fb3fa48721286a64cf508110227bda116.tar.gz
Don't warn about pkgbase and pkg-build-options.mk in the buildlink3.mk
files, since that pattern has become quite common.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl17
1 files changed, 15 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index af8c554ac0f..a68762addf1 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.770 2008/07/25 14:15:44 dillo Exp $
+# $NetBSD: pkglint.pl,v 1.771 2008/08/28 20:38:39 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -5857,7 +5857,11 @@ sub checkline_mk_varassign($$$$$) {
# If the variable is not used and is untyped, it may be a
# spelling mistake.
- if (!var_is_used($varname)) {
+ if ($op eq ":=" && $varname eq lc($varname)) {
+ $opt_warn_unchecked and $line->log_warning("${varname} might be unused unless it is an argument to a procedure file.");
+ # TODO: check $varname against the list of "procedure files".
+
+ } elsif (!var_is_used($varname)) {
my $vartypes = get_vartypes_map();
my $deprecated = get_deprecated_map();
@@ -6747,6 +6751,15 @@ sub checkfile_buildlink3_mk($) {
}
expect_empty_line($lines, \$lineno);
+ # Before the fifth paragraph, it may be necessary to resolve the build
+ # options of other packages.
+ if (expect($lines, \$lineno, qr"^pkgbase\s*:=\s*(\S+)$")) {
+ do {
+ expect_text($lines, \$lineno, ".include \"../../mk/pkg-build-options.mk\"");
+ } while (expect($lines, \$lineno, qr"^pkgbase\s*:=\s*(\S+)$"));
+ expect_empty_line($lines, \$lineno);
+ }
+
# Fifth paragraph (optional): Dependencies.
my $have_dependencies = false;
my $need_empty_line = false;