ports/77787: [PATCH] bsd.php.mk breaks dependency tracking

Dag-Erling Smorgrav des at des.no
Sun Feb 20 16:50:18 UTC 2005


>Number:         77787
>Category:       ports
>Synopsis:       [PATCH] bsd.php.mk breaks dependency tracking
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 20 16:50:17 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Dag-Erling Smorgrav
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD xps.des.no 6.0-CURRENT FreeBSD 6.0-CURRENT #7: Thu Feb 17 15:02:59 CET 2005 des at xps.des.no:/usr/obj/usr/src/sys/xps i386


	
>Description:

bsd.php.mk supports a mechanism to specify required PHP extensions.
For instance, a port Makefile can include the following to specify
a dependency on PHP's pgsql extension:

USE_PHP=	pgsql

Unfortunately, this mechanism is implemented in such a way that if a
dependency is missing from the ports tree, bsd.php.mk will either
silently drop it from the dependency list, or print an error message
and abort, depending on which make target was specified on the command
line.  This breaks tools such as porteasy which use a port's dependency
list to determine which directories to update.

>How-To-Repeat:

$ porteasy -r /home/pcvs -p /tmp/ports -bu databases/phppgadmin
[...]
Unknown extension ctype.
*** Error code 1

Stop in /tmp/ports/databases/phppgadmin.
$ porteasy -r /home/pcvs -p /tmp/ports -lu databases/phppgadmin
   converters/libiconv (libiconv-1.9.2_1)
 * databases/phppgadmin (phppgadmin-3.5.1)
   devel/autoconf259 (autoconf-2.59_2)
   devel/bison (bison-1.75_2)
   devel/gettext (gettext-0.14.1)
   devel/gmake (gmake-3.80_2)
   devel/libtool13 (libtool-1.3.5_2)
   devel/libtool15 (libtool-1.5.10)
   devel/m4 (m4-1.4.1)
   devel/p5-Locale-gettext (p5-gettext-1.03)
   lang/perl5.8 (perl-5.8.6_2)
   lang/php4 (php4-4.3.10_2)
   misc/help2man (help2man-1.34.2)
   textproc/expat2 (expat-1.95.8)
   www/apache2 (apache-2.0.53)

(several PHP extensions are missing from the dependency list)

>Fix:

Apply attached patch.  This will make bsd.php.mk complain about
unknown extensions but not about known extensions whose port
directories are missing.  Porteasy will be able to correctly
determine the dependency list, and update all dependencies:

$ porteasy -r /home/pcvs -p /tmp/ports -lu databases/phppgadmin
[...]
   archivers/php4-zlib (php4-zlib-4.3.10_2)
   converters/libiconv (libiconv-1.9.2_1)
   databases/php4-pgsql (php4-pgsql-4.3.10_2)
 * databases/phppgadmin (phppgadmin-3.5.1)
   devel/autoconf253 (autoconf-2.53_3)
   devel/autoconf259 (autoconf-2.59_2)
   devel/automake15 (automake-1.5_2,1)
   devel/bison (bison-1.75_2)
   devel/gettext (gettext-0.14.1)
   devel/gmake (gmake-3.80_2)
   devel/libtool13 (libtool-1.3.5_2)
   devel/libtool15 (libtool-1.5.10)
   devel/m4 (m4-1.4.1)
   devel/p5-Locale-gettext (p5-gettext-1.03)
   devel/php4-pcre (php4-pcre-4.3.10_2)
   devel/php4-tokenizer (php4-tokenizer-4.3.10_2)
   lang/perl5.8 (perl-5.8.6_2)
   lang/php4 (php4-4.3.10_2)
   mail/cclient (cclient-2004c1_1,1)
   mail/php4-imap (php4-imap-4.3.10_2)
   misc/help2man (help2man-1.34.2)
   security/php4-openssl (php4-openssl-4.3.10_2)
   sysutils/php4-posix (php4-posix-4.3.10_2)
   textproc/expat2 (expat-1.95.8)
   textproc/php4-ctype (php4-ctype-4.3.10_2)
   textproc/php4-xml (php4-xml-4.3.10_2)
   www/apache2 (apache-2.0.53)
   www/php4-session (php4-session-4.3.10_2)

--- bsd.php.mk.diff begins here ---
Index: Mk/bsd.php.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.php.mk,v
retrieving revision 1.12
diff -u -r1.12 bsd.php.mk
--- Mk/bsd.php.mk	17 Dec 2004 06:48:01 -0000	1.12
+++ Mk/bsd.php.mk	18 Dec 2004 07:45:55 -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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list