Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jul 2012 11:56:48 +0100 (BST)
From:      Chris Rees <crees@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/169850: [PATCH] bsd.port.mk -- fix fetch for ports that depend on specific targets
Message-ID:  <20120714105648.70A51FDAF@pegasus.bayofrum.net>
Resent-Message-ID: <201207141100.q6EB09qR079210@freefall.freebsd.org>

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

>Number:         169850
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk -- fix fetch for ports that depend on specific targets
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 14 11:00:09 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD pegasus.bayofrum.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Sun Apr 29 12:29:02 BST 2012 root@pegasus.bayofrum.net:/usr/obj/usr/src/sys/PEGASUS amd64


	
>Description:
	I've (ab)used the Severity and Priority fields here because I believe that they are appropriate here.

	Ports that use alternative targets to depend on others, for example:

	BUILD_DEPENDS=	${NONEXISTENT}:${PORTSDIR}/foo/bar:target

	fail when built in jails that restrict network access during !fetch phase.

	This patch fixes this problem, and was being tested by miwi until recently; I emailed him 11 days ago, but he appears to be AFK.  Before he disappeared he reported that it did fix many ports.

	Ref: http://lists.freebsd.org/pipermail/cvs-all/2012-May/364241.html (this has an older (wrong) patch
>How-To-Repeat:
	Build a port in jailed Tinderbox/poudriere that uses targeted dependencies
>Fix:

	Check for alternative-target dependencies, and automatically fetch them during fetch phase:

--- bsd.port.mk-fetch-depends2.diff begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/Mk/bsd.port.mk,v
retrieving revision 1.711
diff -u -r1.711 bsd.port.mk
--- bsd.port.mk	24 May 2012 07:11:40 -0000	1.711
+++ bsd.port.mk	25 May 2012 17:36:16 -0000
@@ -4299,7 +4299,7 @@
 _PKG_SEQ=		pkg-depends
 _FETCH_DEP=		pkg
 _FETCH_SEQ=		fetch-depends pre-fetch pre-fetch-script \
-				do-fetch post-fetch post-fetch-script
+				do-fetch fetch-specials post-fetch post-fetch-script
 _EXTRACT_DEP=	fetch
 _EXTRACT_SEQ=	check-build-conflicts extract-message checksum extract-depends \
 				pre-extract pre-extract-script do-extract \
@@ -5169,6 +5169,7 @@
 
 _UNIFIED_DEPENDS=${PKG_DEPENDS} ${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}
 _DEPEND_DIRS=	${_UNIFIED_DEPENDS:C,^[^:]*:([^:]*).*$,\1,}
+_DEPEND_SPECIALS=	${_UNIFIED_DEPENDS:M*\:*\:*:C,^[^:]*:([^:]*):.*$,\1,}
 
 all-depends-list:
 	@${ALL-DEPENDS-LIST}
@@ -5304,6 +5305,14 @@
 	done
 .endif
 
+.if !target(fetch-specials)
+fetch-specials:
+	@${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
+	@for dir in ${_DEPEND_SPECIALS}; do \
+		(cd $$dir; ${MAKE} fetch); \
+	done
+.endif
+
 .if !target(fetch-recursive)
 fetch-recursive:
 	@${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
--- bsd.port.mk-fetch-depends2.diff ends here ---


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



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