Subject: lintpkgsrc "fix"
To: None <tech-pkg@NetBSD.org>
From: Sebastian Prause <sebastian-p@gmx.net>
List: tech-pkg
Date: 12/04/2003 00:56:07
hi,

i always had the problem that lintpkgsrc failed to get the distdir right:

# lintpkgsrc -or
Scanning pkgsrc distinfo: ........................................ (4519 packages)
Unable to opendir(UNDEFINED/distfiles): No such file or directory

the problem is that i have the following lines in my /etc/mk.conf:

DISTDIR?=	${_PKGSRCDIR}/distfiles
# Directory where original distribution
# files are stored.
# Possible: any path you like
# Default: /usr/pkgsrc/distfiles

and the _PKGSRCDIR variable wasn't known to lintpkgsrc (which explains the UNDEFINED above).
My patch below makes _PKGSRCDIR an alias to PKGSRCDIR to make my situation work.


--- /usr/pkg/bin/lintpkgsrc     Wed Nov 12 23:06:44 2003
+++ lintpkgsrc  Thu Dec  4 00:41:18 2003
@@ -441,8 +441,7 @@
 
     if ($opt{M})
        { $default_vars->{DISTDIR} = $opt{M}; }
-    else
-       { $default_vars->{DISTDIR} ||= $default_vars->{PKGSRCDIR}.'/distfiles'; }
+    $default_vars->{DISTDIR} ||= $default_vars->{PKGSRCDIR}.'/distfiles';
 
     if ($opt{K})
        { $default_vars->{PACKAGES} = $opt{K}; }
@@ -795,6 +794,8 @@
     else
        { %vars = %{$default_vars}; }
     $vars{BSD_PKG_MK} = 'YES';
+
+    $vars{_PKGSRCDIR} = $default_vars->{PKGSRCDIR};
 
     if ($cwd)
        { $vars{'.CURDIR'} = $cwd; }


     -- Sebastian Prause