NetBSD Problem Report #27875

From njoly@pasteur.fr  Thu Nov  4 12:34:48 2004
Return-Path: <njoly@pasteur.fr>
Received: from electre.pasteur.fr (electre.pasteur.fr [157.99.64.120])
	by narn.netbsd.org (Postfix) with ESMTP id 166832521E9
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  4 Nov 2004 12:34:48 +0000 (UTC)
Message-Id: <20041104123441.9A5BA6B422@lanfeust.sis.pasteur.fr>
Date: Thu,  4 Nov 2004 13:34:41 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: lintpkgsrc(1) generate many `uninitialized value' warnings
X-Send-Pr-Version: 3.95

>Number:         27875
>Category:       pkg
>Synopsis:       lintpkgsrc(1) generate many `uninitialized value' warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 04 12:35:00 +0000 2004
>Closed-Date:    Thu Nov 04 12:38:08 +0000 2004
>Last-Modified:  Thu Nov 04 12:38:08 +0000 2004
>Originator:     Nicolas Joly
>Release:        NetBSD 2.99.10
>Organization:
Institut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 2.99.10 NetBSD 2.99.10 (LANFEUST) #7: Thu Nov 4 11:07:59 CET 2004 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj/amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:

lintpkgsrc(1) generate many warnings on -current pkgsrc:

njoly@lanfeust [~/NetBSD]> lintpkgsrc -i > pkgdepgraph.in
Scanning Makefiles: Use of uninitialized value in pattern match (m//) at /usr/pkg/bin/lintpkgsrc line 747.
Use of uninitialized value in pattern match (m//) at /usr/pkg/bin/lintpkgsrc line 747.
Use of uninitialized value in pattern match (m//) at /usr/pkg/bin/lintpkgsrc line 747.
.......Use of uninitialized value in pattern match (m//) at /usr/pkg/bin/lintpkgsrc line 747.
..Use of uninitialized value in pattern match (m//) at /usr/pkg/bin/lintpkgsrc line 747.
[...]
...Use of uninitialized value in pattern match (m//) at /usr/pkg/bin/lintpkgsrc line 747.
5102 packages                            

>How-To-Repeat:
lintpkgsrc -i > pkgdepgraph.in
>Fix:
Check if `$pkgname' is defined before trying to use it.

Index: pkgtools/pkglint/files/lintpkgsrc.pl
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkglint/files/lintpkgsrc.pl,v
retrieving revision 1.93
diff -u -r1.93 lintpkgsrc.pl
--- pkgtools/pkglint/files/lintpkgsrc.pl	5 Sep 2004 23:12:37 -0000	1.93
+++ pkgtools/pkglint/files/lintpkgsrc.pl	4 Nov 2004 12:22:10 -0000
@@ -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:(/.*)/:);
>Release-Note:
>Audit-Trail:

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/27875 CVS commit: pkgsrc/pkgtools/pkglint
Date: Thu,  4 Nov 2004 12:37:03 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Thu Nov  4 12:37:03 UTC 2004

 Modified Files:
 	pkgsrc/pkgtools/pkglint: Makefile
 	pkgsrc/pkgtools/pkglint/files: lintpkgsrc.pl

 Log Message:
 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.


 To generate a diff of this commit:
 cvs rdiff -r1.208 -r1.209 pkgsrc/pkgtools/pkglint/Makefile
 cvs rdiff -r1.93 -r1.94 pkgsrc/pkgtools/pkglint/files/lintpkgsrc.pl

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed 
State-Changed-By: wiz 
State-Changed-When: Thu Nov 4 12:38:05 UTC 2004 
State-Changed-Why:  
Committed, thanks. 
>Unformatted:
 >Quarter:        
 >Keywords:       
 >Date-Required:  

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.