diff options
author | rillig <rillig@pkgsrc.org> | 2007-11-07 17:01:24 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-11-07 17:01:24 +0000 |
commit | c3d161ff5d25326d1cb0df919c970927d958efbe (patch) | |
tree | 8cf450fbe49d2b2970f01164c28d543f1e407081 /pkgtools | |
parent | 1ddd7f3cd0155f7922299007963200b6a563196f (diff) | |
download | pkgsrc-c3d161ff5d25326d1cb0df919c970927d958efbe.tar.gz |
In variable assignments in the shell you can sometimes leave out the
double quotes.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index d05e9691deb..4f004ffa1b8 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.733 2007/11/07 16:47:27 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.734 2007/11/07 17:01:24 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -4286,6 +4286,14 @@ sub checkline_mk_shellword($$$) { } } elsif ($state == SWST_PLAIN) { + + if ($rest =~ qr"([\w_]+)=\"\`") { + $line->log_note("In the assignment to \"$1\", you don't need double quotes around backticks."); + $line->explain_note( +"Assignments are a special context, where no double quotes are needed", +"around backticks. In other contexts, the double quotes are necessary."); + } + if ($rest =~ s/^[!#\%&\(\)*+,\-.\/0-9:;<=>?\@A-Z\[\]^_a-z{|}~]+//) { } elsif ($rest =~ s/^\'//) { $state = SWST_SQUOT; |