From 1e457582dea332128d5d9f10635dbd765bc5e2ca Mon Sep 17 00:00:00 2001 From: rillig Date: Tue, 6 Jun 2006 11:39:25 +0000 Subject: A variable that appears as a whole shell word may either be used as a list of shell words, or sometimes as a single shell word. Compare: ${LD} ${LDFLAGS} and ./configure -libs ${LDFLAGS:Q}. So in this case, the :Q operator cannot be checked reliably. --- pkgtools/pkglint/files/pkglint.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index b31dbf976c0..e59625e7325 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.606 2006/06/06 09:56:22 seb Exp $ +# $NetBSD: pkglint.pl,v 1.607 2006/06/06 11:39:25 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -1800,7 +1800,7 @@ sub parse_acls($$) { } $acls = []; - while ($acltext =~ s,^(?:\$(\w+)|([\w.*]+|_):([adpsu]*))(?:\,\s*|$),,) { + while ($acltext =~ s,^(?:\$([\w_]+)|([\w.*]+|_):([adpsu]*))(?:\,\s*|$),,) { my ($acldef, $subject, $perms) = ($1, $2, $3); if (defined($acldef)) { @@ -2675,9 +2675,13 @@ sub variable_needs_quoting($$$) { return true; } - # Assigning lists to lists does not require any quoting. + # Assigning lists to lists does not require any quoting, though + # there may be cases like "CONFIGURE_ARGS+= -libs ${LDFLAGS:Q}" + # where quoting is necessary. So let's hope that no developer + # ever makes the mistake of using :Q when appending a list to + # a list. if ($want_list && $have_list) { - return false; + return doesnt_matter; } # Appending elements to a list requires quoting, as well as -- cgit v1.2.3