summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordillo <dillo>2008-07-25 14:15:44 +0000
committerdillo <dillo>2008-07-25 14:15:44 +0000
commit91edcf7ec66b5ba5566fa897d4d6ff3cb93e3db8 (patch)
tree5d01b4764649a9cc9573ddc025c58ec3547c8211
parenta7a8c181888620908f36ebc813d8168ab6658b30 (diff)
downloadpkgsrc-91edcf7ec66b5ba5566fa897d4d6ff3cb93e3db8.tar.gz
Update to 4.87:
- Add explanation for "Unquoted shell variable" warning. Patch by rillig.
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.pl15
2 files changed, 16 insertions, 3 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 8155827b76c..5e13d0a2ad5 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.374 2008/05/21 20:16:19 abs Exp $
+# $NetBSD: Makefile,v 1.375 2008/07/25 14:15:44 dillo Exp $
#
# Please don't increase the version number if you are not rillig.
-DISTNAME= pkglint-4.86
+DISTNAME= pkglint-4.87
CATEGORIES= pkgtools
MASTER_SITES= # none
DISTFILES= # none
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 68ea3e06c9a..af8c554ac0f 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.769 2008/05/21 20:16:19 abs Exp $
+# $NetBSD: pkglint.pl,v 1.770 2008/07/25 14:15:44 dillo Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -4456,6 +4456,19 @@ sub checkline_mk_shellword($$$) {
my ($shvarname) = ($1);
if ($opt_warn_quoting && $check_quoting) {
$line->log_warning("Unquoted shell variable \"${shvarname}\".");
+ $line->explain_warning(
+"When a shell variable contains white-space, it is expanded (split into",
+"multiple words) when it is written as \$variable in a shell script.",
+"If that is not intended, you should add quotation marks around it,",
+"like \"\$variable\". Then, the variable will always expand to a single",
+"word, preserving all white-space and other special characters.",
+"",
+"Example:",
+"\tfname=\"Curriculum vitae.doc\"",
+"\tcp \$fname /tmp",
+"\t# tries to copy the two files \"Curriculum\" and \"Vitae.doc\"",
+"\tcp \"\$fname\" /tmp",
+"\t# copies one file, as intended");
}
} elsif ($rest =~ s/^\$\@//) {