pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Added a warning that prevents...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4af9e3e38f48
branches:  trunk
changeset: 504279:4af9e3e38f48
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Dec 08 09:01:08 2005 +0000

description:
- Added a warning that prevents the quoting issues from the recent
  "pkglint --autofix" change. Added a long and detailed explanation for it.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (34 lines):

diff -r f117112cf338 -r 4af9e3e38f48 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu Dec 08 08:24:15 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu Dec 08 09:01:08 2005 +0000
@@ -11,7 +11,7 @@
 # Freely redistributable.  Absolutely no warranty.
 #
 # From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.431 2005/12/07 21:39:59 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.432 2005/12/08 09:01:08 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -2182,6 +2182,21 @@
        if (exists(get_deprecated_map()->{$varname})) {
                $line->log_warning("Definition of ${varname} is deprecated. ".get_deprecated_map()->{$varname});
        }
+
+       if ($value =~ qr"^[^=]\@comment") {
+               $line->log_warning("Please don't use \@comment in variables.");
+               $line->explain(
+                       "Here you are defining a variable containing \@comment. As this value",
+                       "typically includes a space as the last character you probably also used",
+                       "quotes around the variable. This can lead to confusion when adding this",
+                       "variable to PLIST_SUBST, as all other variables are quoted using the :Q",
+                       "operator when they are appended. As it is hard to check whether a",
+                       "variable that is appended to PLIST_SUBST is already quoted or not, you",
+                       "should not have pre-quoted variables at all. To solve this, you should",
+                       "directly use SUBST_PLIST+= ${varname}=${value} or use any other",
+                       "variable for collecting the list of PLIST substitutions and later",
+                       "append that variable with SUBST_PLIST+= \${MY_SUBST_PLIST}.");
+       }
 }
 
 #



Home | Main Index | Thread Index | Old Index