NetBSD Problem Report #16772

Received: (qmail 22176 invoked from network); 12 May 2002 09:08:54 -0000
Message-Id: <20020512090852.7396B11700@yamt.dyndns.org>
Date: Sun, 12 May 2002 18:08:52 +0900 (JST)
From: yamt@mwd.biglobe.ne.jp
Reply-To: yamt@mwd.biglobe.ne.jp
To: gnats-bugs@gnats.netbsd.org
Subject: port2pkg don't convert ${PORTNAME}
X-Send-Pr-Version: 3.95

>Number:         16772
>Category:       pkg
>Synopsis:       port2pkg don't convert ${PORTNAME}
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun May 12 09:09:00 +0000 2002
>Closed-Date:    Sun May 19 15:41:49 +0000 2002
>Last-Modified:  Sun May 19 15:41:49 +0000 2002
>Originator:     YAMAMOTO Takashi
>Release:        NetBSD 1.5ZC
>Organization:
>Environment:


System: NetBSD bear.yamanet 1.5ZC NetBSD 1.5ZC (build) #13: Wed Apr 3 03:54:19 JST 2002 takashi@bear.yamanet:/usr/home/takashi/work/kernel/build i386
Architecture: i386
Machine: i386
>Description:
	port2pkg don't convert ${PORTNAME}
>How-To-Repeat:
	convert x11/xclip
>Fix:

Index: port2pkg.pl
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/pkgtools/port2pkg/files/port2pkg.pl,v
retrieving revision 1.10
diff -u -r1.10 port2pkg.pl
--- port2pkg.pl	2002/01/01 17:01:01	1.10
+++ port2pkg.pl	2002/05/12 08:58:07
@@ -181,6 +181,7 @@
 		s|^FETCH_(DEPENDS)|BUILD_$1|;
 		s|^LIB_(DEPENDS)|$1|;
 		s|\$\{PORTSDIR\}|../..|g;
+		s|\$\{PORTNAME\}|\${PKGNAME:C/-.*\$//}|g;
 		s|PLIST_SUB|PLIST_SUBST|;

 		if (defined($master_site_subdir) &&
>Release-Note:
>Audit-Trail:

From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: Re: pkg/16772: port2pkg don't convert ${PORTNAME}
Date: Sun, 12 May 2002 18:19:00 +0900 (JST)

 ah, as port name can contain "-",
 It should be:
 s|\$\{PORTNAME\}|\${PKGNAME:C/-[^-]*\$//}|g;

 ---
 YAMAMOTO Takashi<yamt@mwd.biglobe.ne.jp>
State-Changed-From-To: open->feedback 
State-Changed-By: wiz 
State-Changed-When: Sun May 19 08:14:07 PDT 2002 
State-Changed-Why:  
What's an example for the problem? 
In the function conv_Makefile, there is a case for PORTNAME: 
} elsif (/^PORTNAME/) { 
print PKG "DISTNAME=$namespace$distnamen"; 
print PKG "PKGNAME=$namespace$pkgnamen" if defined($pkgname); 
and in read_Makefile there's one, too: 
if (/^PORTNAME?*=(s*)(.*)/) { 
$namespace = $1; 
$portname = $2; 

I guess that if there's a problem, one of these cases should be fixed instead. 
Comments? 

From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: wiz@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/16772
Date: Mon, 20 May 2002 00:36:27 +0900 (JST)

 for example,
 ==== original(FreeBSD) makefile
 PORTNAME=aaa
 FOO=${PORTNAME}

 ==== result
 DISTNAME=aaa
 PKGNAME=aaa
 FOO=${PORTNAME}	# bad!

 one in read_Makefile recognizes 'PORTNAME=aaa' line,
 and one in conv_Makefile extracts it into DISTNAME and PKGNAME.
 my patch converts FOO line in above example.

 ---
 YAMAMOTO Takashi<yamt@mwd.biglobe.ne.jp>
State-Changed-From-To: feedback->closed 
State-Changed-By: wiz 
State-Changed-When: Sun May 19 08:40:32 PDT 2002 
State-Changed-Why:  
Committed, thanks! 
>Unformatted:

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.