pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Update to 4.87:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f4233b3826d4
branches:  trunk
changeset: 545068:f4233b3826d4
user:      dillo <dillo%pkgsrc.org@localhost>
date:      Fri Jul 25 14:15:44 2008 +0000

description:
Update to 4.87:
- Add explanation for "Unquoted shell variable" warning.

Patch by rillig.

diffstat:

 pkgtools/pkglint/Makefile         |   4 ++--
 pkgtools/pkglint/files/pkglint.pl |  15 ++++++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 142f745e87b7 -r f4233b3826d4 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Fri Jul 25 14:07:37 2008 +0000
+++ b/pkgtools/pkglint/Makefile Fri Jul 25 14:15:44 2008 +0000
@@ -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 -r 142f745e87b7 -r f4233b3826d4 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Jul 25 14:07:37 2008 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Fri Jul 25 14:15:44 2008 +0000
@@ -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 @@
                                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/^\$\@//) {



Home | Main Index | Thread Index | Old Index