diff options
author | rillig <rillig@pkgsrc.org> | 2008-03-06 08:51:36 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2008-03-06 08:51:36 +0000 |
commit | e1462f41e697a736d4d90f1e2b88f4809d9e376b (patch) | |
tree | 305c49ccab324291ecbda345f28e2cc29ccd443b /pkgtools | |
parent | 04c6c7db6a5eafef03dc55d660d1cf50473427b7 (diff) | |
download | pkgsrc-e1462f41e697a736d4d90f1e2b88f4809d9e376b.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.pl | 33 |
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) { |