diff options
author | wiz <wiz> | 2003-10-11 08:03:40 +0000 |
---|---|---|
committer | wiz <wiz> | 2003-10-11 08:03:40 +0000 |
commit | e1e94994d32da0a8885e367c62fb6635b6395eb4 (patch) | |
tree | c66189a01d248d1e822567ea527a3d49d76f7a2a /pkgtools | |
parent | 1df6e0fed8ff06642374286f48ab023d1ecf01b9 (diff) | |
download | pkgsrc-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/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 6 |
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*\([^()]+\)/$_/; |