From des@des.no  Mon Oct 25 12:42:21 2004
Return-Path: <des@des.no>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1B16A16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Oct 2004 12:42:21 +0000 (GMT)
Received: from smtp.des.no (flood.des.no [217.116.83.31])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 710F343D41
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Oct 2004 12:42:20 +0000 (GMT)
	(envelope-from des@des.no)
Received: by smtp.des.no (Pony Express, from userid 666)
	id 4D9DD5314; Mon, 25 Oct 2004 14:42:19 +0200 (CEST)
Received: from dwp.des.no (des.no [80.203.228.37])
	by smtp.des.no (Pony Express) with ESMTP id 93E0D5310
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Oct 2004 14:42:11 +0200 (CEST)
Received: by dwp.des.no (Postfix, from userid 2602)
	id 70F0FB85E; Mon, 25 Oct 2004 14:42:11 +0200 (CEST)
Message-Id: <20041025124211.70F0FB85E@dwp.des.no>
Date: Mon, 25 Oct 2004 14:42:11 +0200 (CEST)
From: Dag-Erling Smrgrav <des@des.no>
Reply-To: Dag-Erling Smrgrav <des@des.no>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] bug in PHP dependency checks
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         73116
>Category:       ports
>Synopsis:       [PATCH] bug in PHP dependency checks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ale
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 25 12:50:18 GMT 2004
>Closed-Date:    Mon Mar 14 14:43:42 GMT 2005
>Last-Modified:  Mon Mar 14 14:43:42 GMT 2005
>Originator:     Dag-Erling Smrgrav
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD des.teleplan.no 6.0-CURRENT FreeBSD 6.0-CURRENT #7: Tue Oct 19 12:13:59 EDT 2004 des@des.teleplan.no:/usr/obj/usr/src/sys/latitude i386

head of ports tree

>Description:

For each element in USE_PHP, bsd.php.mk checks not only if it knows about
the category but also if the corresponding port directory exists.

>How-To-Repeat:

On a machine with no ports tree, try for instance

# porteasy -r /path/to/ports/cvs/repo -ku devel/pear-PEAR

This will fail because bsd.php.mk blows up before porteasy has a chance to
figure out that it needs to update devel/php4-pear:

===>   pear-Archive_Tar-1.2 depends on executable: pear - not found
===>    Verifying package for pear in /usr/ports/devel/php4-pear
Unknown extension pcre.
*** Error code 1

>Fix:

The attached patch changes the test from "is this extension present" to
"have I heard of this extension", and allows porteasy to work as designed.

--- bsd.php.mk.diff begins here ---
Index: bsd.php.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.php.mk,v
retrieving revision 1.11
diff -u -r1.11 bsd.php.mk
--- bsd.php.mk	2 Sep 2004 10:08:48 -0000	1.11
+++ bsd.php.mk	25 Oct 2004 12:19:04 -0000
@@ -332,7 +332,7 @@
 zlib_DEPENDS=	archivers/php${PHP_VER}-zlib
 
 .	for extension in ${USE_PHP}
-.		if ${_USE_PHP_ALL:M${extension}} != "" && exists(${PORTSDIR}/${${extension}_DEPENDS})
+.		if ${_USE_PHP_ALL:M${extension}} != "" && defined(${extension}_DEPENDS)
 .			if defined(USE_PHP_BUILD)
 BUILD_DEPENDS+=	${LOCALBASE}/lib/php/${PHP_EXT_DIR}/${extension}.so:${PORTSDIR}/${${extension}_DEPENDS}
 .			endif
--- bsd.php.mk.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: pav 
Responsible-Changed-When: Mon Oct 25 21:31:43 GMT 2004 
Responsible-Changed-Why:  
Over to bsd.php.mk maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73116 

From: Alex Dupre <ale@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, des@des.no
Cc:  
Subject: Re: ports/73116: [PATCH] bug in PHP dependency checks
Date: Tue, 26 Oct 2004 08:02:49 +0200

 This patch isn't correct, it avoids any checks on the existence of the 
 port (and this was my intention) and double checks the existence of the 
 variable. A possible solution to your problem is to check the existence 
 of the category directory, if the port directory is missing. If it 
 exists, then the extension is unknown, otherwise you have to cvsup that 
 catergory.
 
 -- 
 Alex Dupre

From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To: Alex Dupre <ale@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/73116: [PATCH] bug in PHP dependency checks
Date: Tue, 26 Oct 2004 08:48:17 +0200

 Alex Dupre <ale@FreeBSD.org> writes:
 > This patch isn't correct, it avoids any checks on the existence of the
 > port (and this was my intention) and double checks the existence of
 > the variable.
 
 The ports system already has a mechanism for verifying the existence
 of a port directory (although it is arguably broken, because it only
 warns about the missing dependency instead of failing, but that is a
 separate issue).  That mechanism requires working *_DEPENDS, which
 bsd.php.mk does not provide.
 
 >               A possible solution to your problem is to check the
 > existence of the category directory, if the port directory is
 > missing. If it exists, then the extension is unknown, otherwise you
 > have to cvsup that catergory.
 
 You obviously don't understand how porteasy works.  It updates
 individual ports, not entire categories.
 
 DES
 --=20
 Dag-Erling Sm=F8rgrav - des@des.no
State-Changed-From-To: open->closed 
State-Changed-By: ale 
State-Changed-When: Mon Mar 14 14:43:10 GMT 2005 
State-Changed-Why:  
Fixed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73116 
>Unformatted:
