Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Nov 2005 08:05:25 +0100 (CET)
From:      Anton Berezin <tobez@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/89448: bsd.port.mk: improve behavior when dealing with versioned dependencies
Message-ID:  <20051123070525.D9862125451@heechee.tobez.org>
Resent-Message-ID: <200511230710.jAN7ADSL094495@freefall.freebsd.org>

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

>Number:         89448
>Category:       ports
>Synopsis:       bsd.port.mk: improve behavior when dealing with versioned dependencies
>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:   Wed Nov 23 07:10:13 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Anton Berezin
>Release:        FreeBSD 5.4-STABLE amd64
>Organization:
>Environment:

	
>Description:

Currently, the existing mechanism of version dependencies
(BUILD_DEPENDS=pkg_a>0.42:pkg_a_port) behaves somewhat
counter-intuitively when an incompatible with this specification
version of pkg_a is installed (say, version 0.21).  Namely,
the "not found" condition is detected and the build of the current
version of pkg_a_port is commensed.  This leads nowhere, however,
since the install stage refuses to install a newer version of
pkg_a on top of already installed version.  This is a good thing
in and by itself, but the behavior can and should be improved, so
that the user gets earlier indication that something is amiss and
a less cryptic error message.

>How-To-Repeat:

>Fix:

The proposed fix, upon detection of the condition described above,
tries to determine whether another, incompatible version of the
package is installed.  If that is the case, the build process is
interrupted immediately, with a (hopefully) sane error message.

Thanks to lth for poking me about this and to him and to lars@balker.dk
for testing and discussion.

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.518
diff -u -r1.518 bsd.port.mk
--- bsd.port.mk	8 Nov 2005 09:02:51 -0000	1.518
+++ bsd.port.mk	23 Nov 2005 06:54:11 -0000
@@ -4343,6 +4343,16 @@
 					${ECHO_MSG} "===>   ${PKGNAME} depends on package: $$prog - not found"; \
 					notfound=1; \
 				fi; \
+				if [ $$notfound != 0 ]; then \
+					inverse_dep=`${ECHO_CMD} $$prog | ${SED} \
+						-e 's/<=/=gt=/; s/</=ge=/; s/>=/=lt=/; s/>/=le=/' \
+						-e 's/=gt=/>/; s/=ge=/>=/; s/=lt=/</; s/=le=/<=/'`; \
+					pkg_info=`${PKG_INFO} -E "$$inverse_dep" || ${TRUE}`; \
+					if [ "$$pkg_info" != "" ]; then \
+						${ECHO_MSG} "===>   Found $$pkg_info, but you need to upgrade to $$prog."; \
+						exit 1; \
+					fi; \
+				fi; \
 			elif ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
 				${ECHO_MSG} "===>   ${PKGNAME} depends on executable: $$prog - found"; \
 				if [ ${_DEPEND_ALWAYS} = 1 ]; then \

>Release-Note:
>Audit-Trail:
>Unformatted:



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