summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2008-03-06 08:51:36 +0000
committerrillig <rillig>2008-03-06 08:51:36 +0000
commit7a99b6d79537fcda439e90d0e156efd6d3f2953f (patch)
tree305c49ccab324291ecbda345f28e2cc29ccd443b /pkgtools
parent010b759b1851eacce49e319a224e7171b7b2189b (diff)
downloadpkgsrc-7a99b6d79537fcda439e90d0e156efd6d3f2953f.tar.gz
The LOCALBASE variable should not be used in packages, it should just be
defined in mk.conf. Suggested by jlam, who also provided the excellent explanation (see "pkglint -e" for it).
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl33
1 files changed, 32 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 09ea9c156cd..6cf302b05f2 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.767 2008/03/06 08:37:26 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.768 2008/03/06 08:51:36 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -4121,6 +4121,37 @@ sub checkline_mk_varuse($$$$) {
}
}
+ if ($varname eq "LOCALBASE" && !$is_internal) {
+ $line->log_warning("The LOCALBASE variable should not be used by packages.");
+ $line->explain_warning(
+# from jlam via private mail.
+"Currently, LOCALBASE is typically used in these cases:",
+"",
+"(1) To locate a file or directory from another package.",
+"(2) To refer to own files after installation.",
+"",
+"In the first case, the example is:",
+"",
+" STRLIST= \${LOCALBASE}/bin/strlist",
+" do-build:",
+" cd \${WRKSRC} && \${STRLIST} *.str",
+"",
+"This should really be:",
+"",
+" EVAL_PREFIX= STRLIST_PREFIX=strlist",
+" STRLIST= \${STRLIST_PREFIX}/bin/strlist",
+" do-build:",
+" cd \${WRKSRC} && \${STRLIST} *.str",
+"",
+"In the second case, the example is:",
+"",
+" CONFIGURE_ENV+= --with-datafiles=\${LOCALBASE}/share/battalion",
+"",
+"This should really be:",
+"",
+" CONFIGURE_ENV+= --with-datafiles=\${PREFIX}/share/battalion");
+ }
+
my $needs_quoting = variable_needs_quoting($line, $varname, $context);
if ($context->shellword == VUC_SHELLWORD_FOR) {