pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Make lintpkgsrc handle .includes corr...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/41a112c7aaa2
branches:  trunk
changeset: 461800:41a112c7aaa2
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Sep 21 20:32:35 2003 +0000

description:
Make lintpkgsrc handle .includes correctly. Welcome to 3.61.

diffstat:

 pkgtools/pkglint/Makefile            |   4 ++--
 pkgtools/pkglint/files/lintpkgsrc.pl |  24 +++++++++++++++++++++---
 2 files changed, 23 insertions(+), 5 deletions(-)

diffs (82 lines):

diff -r 144eac88f9c1 -r 41a112c7aaa2 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun Sep 21 20:03:52 2003 +0000
+++ b/pkgtools/pkglint/Makefile Sun Sep 21 20:32:35 2003 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.167 2003/09/06 08:52:58 wiz Exp $
+# $NetBSD: Makefile,v 1.168 2003/09/21 20:32:35 wiz Exp $
 #
 
-DISTNAME=      pkglint-3.60
+DISTNAME=      pkglint-3.61
 WRKSRC=                ${WRKDIR}
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
diff -r 144eac88f9c1 -r 41a112c7aaa2 pkgtools/pkglint/files/lintpkgsrc.pl
--- a/pkgtools/pkglint/files/lintpkgsrc.pl      Sun Sep 21 20:03:52 2003 +0000
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl      Sun Sep 21 20:32:35 2003 +0000
@@ -1,6 +1,6 @@
 #!@PREFIX@/bin/perl
 
-# $NetBSD: lintpkgsrc.pl,v 1.81 2003/09/07 15:07:10 wiz Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.82 2003/09/21 20:32:36 wiz Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -778,7 +778,7 @@
 sub parse_makefile_vars
     {
     my($file, $cwd) = @_;
-    my($pkgname, %vars, $plus, $value, @data,
+    my($CURDIR, $NEWCURDIR, $pkgname, %vars, $plus, $value, @data,
        %incfiles,
        @if_false); # 0:true 1:false 2:nested-false&nomore-elsif
 
@@ -801,6 +801,7 @@
        { $vars{'.CURDIR'} = $1; }
     else
        { $vars{'.CURDIR'} = getcwd; }
+    $CURDIR = $vars{'.CURDIR'};
     if ($opt{L})
        { print "$file\n"; }
 
@@ -859,6 +860,13 @@
 
         $if_false[$#if_false] && next;
 
+       # for getting the path for .includes right
+       if (m#__CURDIR__=#)
+           {
+           s/__CURDIR__=//;
+           $CURDIR = $_;
+           next;
+           }
        # Included files (just unshift onto @data)
        #
        if (m#^\.include\s+"([^"]+)"#)
@@ -878,7 +886,15 @@
                # Handle relative path incfile
                #
                if (substr($incfile, 0, 1) ne '/')
-                   { $incfile = "$vars{'.CURDIR'}/$incfile"; }
+                   {
+                   $incfile = "$CURDIR/$incfile";
+                   $NEWCURDIR = $incfile;
+                   $NEWCURDIR =~ s#/[^/]*$##;
+                   }
+               else
+                   {
+                   $NEWCURDIR = $CURDIR;
+                   }
                if (!$incfiles{$incfile})
                    {
                    $incfiles{$incfile} = 1;
@@ -886,7 +902,9 @@
                        { verbose("Cannot open '$incfile' (from $file): $!\n");}
                    else
                        {
+                       unshift(@data, "__CURDIR__=$CURDIR");
                        unshift(@data, map {chomp; $_} <FILE>);
+                       unshift(@data, "__CURDIR__=$NEWCURDIR");
                        close(FILE);
                        }
                    }



Home | Main Index | Thread Index | Old Index