Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 May 2004 15:54:57 +0200
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/66389: [PATCH] bsd.port.mk: follow MOVED ports
Message-ID:  <409CE6B1.9040009@fillmore-labs.com>
Resent-Message-ID: <200405081400.i48E0V6M060149@freefall.freebsd.org>

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

>Number:         66389
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk: follow MOVED ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 08 07:00:31 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Oliver Eikemeier
>Release:        FreeBSD 4.10-STABLE i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 4.10-STABLE

>Description:

This patch tries to find a port in MOVED if it is listed in _*DEPENDS
but can't be found in the ports tree. This might lessen the possibility
to break builds after repocopies, or at least give an indication what
has happened.

>How-To-Repeat:

try

 RUN_DEPENDS+=	R:${PORTSDIR}/math/R-letter

or

 LIB_DEPENDS+=	ldap.2:${PORTSDIR}/net/openldap2

>Fix:

This patch needs some more testing, and is another example that
bsd.ports.mk should be refactored:

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.488
diff -u -r1.488 bsd.port.mk
--- bsd.port.mk	19 Apr 2004 23:39:52 -0000	1.488
+++ bsd.port.mk	8 May 2004 13:43:09 -0000
@@ -1003,6 +1009,7 @@
 .else
 INDEXFILE?=		INDEX
 .endif
+MOVEDFILE?=		MOVED
 .if defined(USE_BZIP2)
 EXTRACT_SUFX?=			.tar.bz2
 .elif defined(USE_ZIP)
@@ -4044,6 +4172,25 @@
 		fi; \
 		if [ $$notfound != 0 ]; then \
 			${ECHO_MSG} "===>    Verifying $$target for $$prog in $$dir"; \
+			if [ ! -d "$$dir" -a -f "${PORTSDIR}/${MOVEDFILE}" ]; then \
+				depends_origin=`${EXPR} "$$dir" : "${PORTSDIR}/\(.*\)"`; \
+				if [ -n "$$depends_origin" ]; then \
+					${ECHO_MSG} "===>    Searching for $$depends_origin:"; \
+					depends_origin=`${AWK} -F\| -v follow="$$depends_origin" '\
+						/^(\#|$$)/ {next} \
+						$$1 == follow { \
+							if (!follow) next; \
+							follow = $$2; \
+							print "     >> " $$3 ": " $$4 " -> " \
+								($$2 ? $$2 : "deleted") > "/dev/stderr"; \
+						} \
+						END { print follow } \
+					' "${PORTSDIR}/${MOVEDFILE}"` 2>&1; \
+					if [ -n "$$depends_origin" ]; then \
+						dir="${PORTSDIR}/$$depends_origin"; \
+					fi ; \
+				fi ; \
+			fi ; \
 			if [ ! -d "$$dir" ]; then \
 				${ECHO_MSG} "     >> No directory for $$prog.  Skipping.."; \
 			else \
@@ -4100,6 +4247,25 @@
 		fi; \
 		if [ $$notfound != 0 ]; then \
 			${ECHO_MSG} "===>    Verifying $$target for $$lib in $$dir"; \
+			if [ ! -d "$$dir" -a -f "${PORTSDIR}/${MOVEDFILE}" ]; then \
+				depends_origin=`${EXPR} "$$dir" : "${PORTSDIR}/\(.*\)"`; \
+				if [ -n "$$depends_origin" ]; then \
+					${ECHO_MSG} "===>    Searching for $$depends_origin:"; \
+					depends_origin=`${AWK} -F\| -v follow="$$depends_origin" '\
+						/^(\#|$$)/ {next} \
+						$$1 == follow { \
+							if (!follow) next; \
+							follow = $$2; \
+							print "     >> " $$3 ": " $$4 " -> " \
+								($$2 ? $$2 : "deleted") > "/dev/stderr"; \
+						} \
+						END { print follow } \
+					' "${PORTSDIR}/${MOVEDFILE}"` 2>&1; \
+					if [ -n "$$depends_origin" ]; then \
+						dir="${PORTSDIR}/$$depends_origin"; \
+					fi ; \
+				fi ; \
+			fi ; \
 			if [ ! -d "$$dir" ]; then \
 				${ECHO_MSG} "     >> No directory for $$lib.  Skipping.."; \
 			else \
@@ -4137,6 +4303,25 @@
 		fi; \
 		${ECHO_MSG} "===>   ${PKGNAME} depends on: $$dir"; \
 		${ECHO_MSG} "===>    Verifying $$target for $$dir"; \
+		if [ ! -d "$$dir" -a -f "${PORTSDIR}/${MOVEDFILE}" ]; then \
+			depends_origin=`${EXPR} "$$dir" : "${PORTSDIR}/\(.*\)"`; \
+			if [ -n "$$depends_origin" ]; then \
+				${ECHO_MSG} "===>    Searching for $$depends_origin:"; \
+				depends_origin=`${AWK} -F\| -v follow="$$depends_origin" '\
+					/^(\#|$$)/ {next} \
+					$$1 == follow { \
+						if (!follow) next; \
+						follow = $$2; \
+						print "     >> " $$3 ": " $$4 " -> " \
+							($$2 ? $$2 : "deleted") > "/dev/stderr"; \
+					} \
+					END { print follow } \
+				' "${PORTSDIR}/${MOVEDFILE}"` 2>&1; \
+				if [ -n "$$depends_origin" ]; then \
+					dir="${PORTSDIR}/$$depends_origin"; \
+				fi ; \
+			fi ; \
+		fi ; \
 		if [ ! -d $$dir ]; then \
 			${ECHO_MSG} "     >> No directory for $$dir.  Skipping.."; \
 		else \
@@ -4161,6 +4346,25 @@
 ALL-DEPENDS-LIST= \
 	checked="${PARENT_CHECKED}"; \
 	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
+		if [ ! -d "$$dir" -a -f "${PORTSDIR}/${MOVEDFILE}" ]; then \
+			depends_origin=`${EXPR} "$$dir" : "${PORTSDIR}/\(.*\)"`; \
+			if [ -n "$$depends_origin" ]; then \
+				${ECHO_MSG} "${PKGNAME}: Searching for $$depends_origin:" >&2; \
+				depends_origin=`${AWK} -F\| -v follow="$$depends_origin" '\
+					/^(\#|$$)/ {next} \
+					$$1 == follow { \
+						if (!follow) next; \
+						follow = $$2; \
+						print "   >> " $$3 ": " $$4 " -> " \
+							($$2 ? $$2 : "deleted") > "/dev/stderr"; \
+					} \
+					END { print follow } \
+				' "${PORTSDIR}/${MOVEDFILE}"`; \
+				if [ -n "$$depends_origin" ]; then \
+					dir="${PORTSDIR}/$$depends_origin"; \
+				fi ; \
+			fi ; \
+		fi ; \
 		if [ -d $$dir ]; then \
 			if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
 				child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" run-depends-list); \

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



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