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 "Please use ${FOO} inst...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1000863eaba7
branches:  trunk
changeset: 505902:1000863eaba7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Jan 09 02:47:56 2006 +0000

description:
- Added "Please use ${FOO} instead of $(FOO)."
- It is an error if the COMMENT has the default value from url2pkg.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 9d1f579216f4 -r 1000863eaba7 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Mon Jan 09 01:28:05 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Mon Jan 09 02:47:56 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@ -w
-# $NetBSD: pkglint.pl,v 1.457 2006/01/08 15:55:13 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.458 2006/01/09 02:47:56 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -1690,6 +1690,13 @@
                }
        }
 
+       $rest = $text;
+       while ($rest =~ s/\$\(([-A-Z0-9a-z_]+)(?::[^\}]+)?\)//) {
+               my ($varname) = ($1);
+
+               $line->log_warning("Please use \${${varname}\} instead of \$(${varname}).");
+       }
+
 }
 
 sub checkline_mk_shellword($$$) {
@@ -2057,6 +2064,9 @@
                }
 
        } elsif ($type eq "Comment") {
+               if ($value eq "SHORT_DESCRIPTION_OF_THE_PACKAGE") {
+                       $line->log_error("COMMENT must be set.");
+               }
                if ($value =~ qr"^(a|an)\s+"i) {
                        $line->log_warning("COMMENT should not begin with '$1'.");
                }
@@ -3004,8 +3014,6 @@
 
        checkperms($fname);
 
-       # TODO: "Please use \${VARIABLE} instead of \$(VARIABLE)."
-
        if (!exists($makevar->{"PLIST_SRC"})
            && !exists($makevar->{"NO_PKG_REGISTER"})
            && !-f "${current_dir}/$pkgdir/PLIST"



Home | Main Index | Thread Index | Old Index