Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Apr 2005 14:54:41 +0200 (CEST)
From:      Anton Berezin <tobez@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/79823: Add an ability to depend on versioned installed package to bsd.port.mk
Message-ID:  <20050412125441.7C3E8125475@heechee.tobez.org>
Resent-Message-ID: <200504121300.j3CD0ppQ026376@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         79823
>Category:       ports
>Synopsis:       Add an ability to depend on versioned installed package to bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 12 13:00:51 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Anton Berezin
>Release:        FreeBSD 5.4-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD heechee.tobez.org 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #1: Tue Mar 22 11:25:20 CET 2005 root@heechee.tobez.org:/usr/obj/usr/src/sys/TU4A amd64

>Description:

Sometimes it is easier to depend on a particular package rather than on
a file installed by that package.  Furthermore, sometimes it is useful
to be able to specify the minimum required version of the dependant
package.
>How-To-Repeat:

>Fix:

With the patch below, it is possible to say, for example,

BUILD_DEPENDS=	p5-Tree-Simple>=1.12:${PORTSDIR}/devel/p5-Tree-Simple

The patch does not affect dependencies specified in the "usual" way.

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.511
diff -u -r1.511 bsd.port.mk
--- bsd.port.mk	17 Mar 2005 23:22:07 -0000	1.511
+++ bsd.port.mk	12 Apr 2005 12:45:09 -0000
@@ -4225,7 +4225,7 @@
 ${deptype:L}-depends:
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
-	@for i in ${${deptype}_DEPENDS}; do \
+	@for i in `${ECHO_CMD} "${${deptype}_DEPENDS}"`; do \
 		prog=`${ECHO_CMD} $$i | ${SED} -e 's/:.*//'`; \
 		dir=`${ECHO_CMD} $$i | ${SED} -e 's/[^:]*://'`; \
 		if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
@@ -4254,7 +4254,21 @@
 				notfound=1; \
 			fi; \
 		else \
-			if ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
+			pkg="`${ECHO_CMD} $$prog | ${SED} -e 's/^\(.*\)[>=<][>=<]*.*/\1/'`" ; \
+			if [ "$$pkg" != "" ]; then \
+				if ${PKG_INFO} "$$prog" > /dev/null 2>&1 ; then \
+					${ECHO_MSG} "===>   ${PKGNAME} depends on package: $$prog - found"; \
+					if [ ${_DEPEND_ALWAYS} = 1 ]; then \
+						${ECHO_MSG} "       (but building it anyway)"; \
+						notfound=1; \
+					else \
+						notfound=0; \
+					fi; \
+				else \
+					${ECHO_MSG} "===>   ${PKGNAME} depends on package: $$prog - not found"; \
+					notfound=1; \
+				fi; \
+			elif ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
 				${ECHO_MSG} "===>   ${PKGNAME} depends on executable: $$prog - found"; \
 				if [ ${_DEPEND_ALWAYS} = 1 ]; then \
 					${ECHO_MSG} "       (but building it anyway)"; \
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050412125441.7C3E8125475>