pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Don't warn on empty scripts/ director...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6317451a2103
branches:  trunk
changeset: 496283:6317451a2103
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Jun 24 22:36:59 2005 +0000

description:
Don't warn on empty scripts/ directories, which may occur during CVS
updates. Don't write logging messages for Makefiles that are being read
but for Makefiles that are included and for those whose inclusion is
skipped. Skip include files that contain Make variables. When checking
for direct use of shell commands, don't print the line continuation,
that is the trailing white-space and backslash. These changes lead to
pkglint-4.18.

diffstat:

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

diffs (78 lines):

diff -r 23339d762405 -r 6317451a2103 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Fri Jun 24 22:23:05 2005 +0000
+++ b/pkgtools/pkglint/Makefile Fri Jun 24 22:36:59 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.242 2005/06/14 03:52:01 rillig Exp $
+# $NetBSD: Makefile,v 1.243 2005/06/24 22:36:59 rillig Exp $
 #
 
-DISTNAME=      pkglint-4.17.1
+DISTNAME=      pkglint-4.18
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 23339d762405 -r 6317451a2103 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Jun 24 22:23:05 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Fri Jun 24 22:36:59 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.193 2005/06/14 03:52:01 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.194 2005/06/24 22:36:59 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -667,7 +667,7 @@
        if (grep { $_ !~ qr"/CVS$" } <$opt_packagedir/pkg/*>) {
                log_error("$opt_packagedir/pkg", NO_LINE_NUMBER, "This directory and its contents are deprecated! Please 'mv $opt_packagedir/pkg/* $opt_packagedir' and 'rmdir $opt_packagedir/pkg'.");
        }
-       if (-d "$opt_packagedir/scripts") {
+       if (grep { $_ !~ qr"/CVS$" } <$opt_packagedir/scripts/*>) {
                log_warning("$opt_packagedir/scripts", NO_LINE_NUMBER, "This directory and its contents are deprecated! Please call the script(s) explicitly from the corresponding target(s) in the 
pkg's Makefile.");
        }
        if (! -f "$opt_packagedir/$pkgdir/PLIST"
@@ -1112,8 +1112,6 @@
        my $contents = "";
        my ($includefile, $dirname, $savedln, $level, $lines);
 
-       log_info($file, NO_LINE_NUMBER, "Reading Makefile.");
-
        $lines = load_file($file);
        if (!defined ($lines)) {
                return false;
@@ -1129,11 +1127,8 @@
                }
                push(@{$all_lines}, $line);
                # try to get any included file
-               if ($line->text =~ /^.include\s+([^\n]+)$/) {
+               if ($line->text =~ qr"^\.\s*include\s+\"([-./\w]+)\"$") {
                        $includefile = $1;
-                       if ($includefile =~ /\"([^\"]+)\"/) {
-                               $includefile = $1;
-                       }
                        if (exists($seen_Makefile_include{$includefile})) {
                                $contents .= "### pkglint ### skipped $includefile\n";
                                next;
@@ -1164,9 +1159,12 @@
                                if (!-f "$dirname/$includefile") {
                                        $line->log_error("Cannot read $dirname/$includefile.");
                                } else {
+                                       $line->log_info("Including $dirname/$includefile");
                                        $contents .= readmakefile("$dirname/$includefile", $all_lines);
                                }
                        }
+               } elsif ($line->text =~ qr"^\.\s*include\s+(.*)") {
+                       $line->log_info("Skipping include file $1");
                } else {
                        $contents .= $line->text . "\n";
                }
@@ -1328,7 +1326,7 @@
                        } else {
                                $line->log_warning("Possible direct use of \"${tool}\" in variable ${varname}. Please use \$\{$toolvar{$tool}\} instead.");
                        }
-               } elsif ($text =~ qr"^\t(.*)") {
+               } elsif ($text =~ qr"^\t(.*?)(?:\s*\\)?$") {
                        my ($shellcmd) = ($1);
                        # process shell commands
                        if ($shellcmd =~ $regex_ok_shellcmds) {



Home | Main Index | Thread Index | Old Index