summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorwiz <wiz>2003-10-11 08:03:40 +0000
committerwiz <wiz>2003-10-11 08:03:40 +0000
commite1e94994d32da0a8885e367c62fb6635b6395eb4 (patch)
treec66189a01d248d1e822567ea527a3d49d76f7a2a /pkgtools
parent1df6e0fed8ff06642374286f48ab023d1ecf01b9 (diff)
downloadpkgsrc-e1e94994d32da0a8885e367c62fb6635b6395eb4.tar.gz
Teach lintpkgsrc how to handle empty() conditionals.
Closes second part of PR 23126. Welcome to 3.65!.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rwxr-xr-xpkgtools/pkglint/files/lintpkgsrc.pl6
2 files changed, 6 insertions, 4 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index d1357f68f2b..84cc5526458 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.171 2003/10/06 08:50:40 grant Exp $
+# $NetBSD: Makefile,v 1.172 2003/10/11 08:03:40 wiz Exp $
#
-DISTNAME= pkglint-3.64
+DISTNAME= pkglint-3.65
WRKSRC= ${WRKDIR}
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl
index cfc2c17eee4..d84f3cf1b59 100755
--- a/pkgtools/pkglint/files/lintpkgsrc.pl
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl
@@ -1,6 +1,6 @@
#!@PREFIX@/bin/perl
-# $NetBSD: lintpkgsrc.pl,v 1.85 2003/10/06 08:50:40 grant Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.86 2003/10/11 08:03:40 wiz Exp $
# Written by David Brownlee <abs@netbsd.org>.
#
@@ -1049,13 +1049,15 @@ sub parse_eval_make_false
$test =~ s/\r/""/g;
debug("conditional: $test\n");
- # XXX Could do something with target and empty
+ # XXX Could do something with target
while ( $test =~ /(target|empty|make|defined|exists)\s*\(([^()]+)\)/ )
{
if ($1 eq 'exists')
{ $_ = (-e $2) ?1 :0; }
elsif( $1 eq 'defined')
{ $_ = (defined($${vars}{$2}) ?1 :0); }
+ elsif( $1 eq 'empty')
+ { $_ = ((not defined($${vars}{$2}) or (length($${vars}{$2}) == 0)) ?1 :0); }
else
{ $_ = 0; }
$test =~ s/$1\s*\([^()]+\)/$_/;