summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2007-11-07 17:01:24 +0000
committerrillig <rillig>2007-11-07 17:01:24 +0000
commit1cc6fdf4ea577cf341a745d5d6ffbee848dd2f66 (patch)
tree8cf450fbe49d2b2970f01164c28d543f1e407081 /pkgtools
parent996edae96d8946dcb2637d46896a7e251b08031c (diff)
downloadpkgsrc-1cc6fdf4ea577cf341a745d5d6ffbee848dd2f66.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.pl10
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;