pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Test if pkgname is defined before usi...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d3b875f33138
branches:  trunk
changeset: 482872:d3b875f33138
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu Nov 04 12:37:02 2004 +0000

description:
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.

diffstat:

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

diffs (33 lines):

diff -r f64ebaf93c5c -r d3b875f33138 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Thu Nov 04 12:20:18 2004 +0000
+++ b/pkgtools/pkglint/Makefile Thu Nov 04 12:37:02 2004 +0000
@@ -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 -r f64ebaf93c5c -r d3b875f33138 pkgtools/pkglint/files/lintpkgsrc.pl
--- a/pkgtools/pkglint/files/lintpkgsrc.pl      Thu Nov 04 12:20:18 2004 +0000
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl      Thu Nov 04 12:37:02 2004 +0000
@@ -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 <abs%netbsd.org@localhost>.
 #
@@ -744,7 +744,7 @@
     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:(/.*)/:);



Home | Main Index | Thread Index | Old Index