From 08c9a32b536d7c04efe3c4d6c3111e0a2b6a510f Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 4 Nov 2004 12:37:02 +0000 Subject: Test if pkgname is defined before using it; gets rid of some warnings: Use of uninitialized value in pattern match (m//) at /usr/pkg/bin/lintpkgsrc line 747. Patch from Nicolas Joly in PR 27875. --- pkgtools/pkglint/Makefile | 4 ++-- pkgtools/pkglint/files/lintpkgsrc.pl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 6c0d9c6e905..7d4a8ae913b 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.208 2004/10/28 13:03:10 wiz Exp $ +# $NetBSD: Makefile,v 1.209 2004/11/04 12:37:02 wiz Exp $ # -DISTNAME= pkglint-3.94 +DISTNAME= pkglint-3.95 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index f8794a5462d..5f86304b15b 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!@PERL@ -# $NetBSD: lintpkgsrc.pl,v 1.93 2004/09/05 23:12:37 seb Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.94 2004/11/04 12:37:02 wiz Exp $ # Written by David Brownlee . # @@ -744,7 +744,7 @@ sub parse_makefile_pkgsrc if (defined $vars->{DISTNAME}) { debug("$file: DISTNAME=$vars->{DISTNAME}\n"); } - if ($pkgname !~ /(.*)-(\d.*)/) + if (! defined $pkgname || $pkgname !~ /(.*)-(\d.*)/) { # invoke make here as a last resort my($pkgsrcdir) = ($file =~ m:(/.*)/:); -- cgit v1.2.3