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 ${VARIABLE...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0344cbe95c9a
branches:  trunk
changeset: 520837:0344cbe95c9a
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Oct 30 22:27:07 2006 +0000

description:
Added a warning that ${VARIABLES} in the DESCR file are not expanded.
(Requested in PR 34920.)

The warning about uncommitted patch files only appears when the distinfo
file is already committed.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r c8168d0e3c9a -r 0344cbe95c9a pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Mon Oct 30 21:53:54 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Mon Oct 30 22:27:07 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.683 2006/10/24 07:18:41 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.684 2006/10/30 22:27:07 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -6291,6 +6291,9 @@
                checkline_trailing_whitespace($line);
                checkline_valid_characters($line, regex_validchars);
                checkline_spellcheck($line);
+               if ($line->text =~ qr"\$\{") {
+                       $line->log_warning("Variables are not expanded in the DESCR file.");
+               }
        }
        checklines_trailing_empty_lines($lines);
 
@@ -6309,6 +6312,7 @@
 sub checkfile_distinfo($) {
        my ($fname) = @_;
        my ($lines, %in_distinfo, $current_fname, $state, $patches_dir);
+       my ($di_is_committed);
 
        use constant DIS_start  => 0;
        use constant DIS_SHA1   => 0;   # same as DIS_start
@@ -6317,6 +6321,8 @@
 
        $opt_debug_trace and log_debug($fname, NO_LINES, "checkfile_distinfo()");
 
+       $di_is_committed = is_committed($fname);
+
        checkperms($fname);
        if (!($lines = load_file($fname))) {
                log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
@@ -6417,7 +6423,7 @@
 
                if ($is_patch && defined($patches_dir)) {
                        my $fname = "${current_dir}/${patches_dir}/${chksum_fname}";
-                       if (!is_committed($fname)) {
+                       if ($di_is_committed && !is_committed($fname)) {
                                $line->log_warning("${patches_dir}/${chksum_fname} is registered in distinfo but not added to CVS.");
                        }
 



Home | Main Index | Thread Index | Old Index