From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jan 23 21:30:13 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 168F01065676 for ; Mon, 23 Jan 2012 21:30:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E0FCF8FC15 for ; Mon, 23 Jan 2012 21:30:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0NLUC1v062290 for ; Mon, 23 Jan 2012 21:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0NLUCow062287; Mon, 23 Jan 2012 21:30:12 GMT (envelope-from gnats) Resent-Date: Mon, 23 Jan 2012 21:30:12 GMT Resent-Message-Id: <201201232130.q0NLUCow062287@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Greg Larkin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E7B510656B5 for ; Mon, 23 Jan 2012 21:27:37 +0000 (UTC) (envelope-from glarkin@pm.sourcehosting.net) Received: from mail1.sourcehosting.net (mail1.sourcehosting.net [74.205.51.45]) by mx1.freebsd.org (Postfix) with ESMTP id 550068FC1A for ; Mon, 23 Jan 2012 21:27:37 +0000 (UTC) Received: from [192.168.100.97] (helo=pm.sourcehosting.net) by mail1.sourcehosting.net with esmtp (Exim 4.73 (FreeBSD)) (envelope-from ) id 1RpR9K-000IEk-UY for FreeBSD-gnats-submit@freebsd.org; Mon, 23 Jan 2012 16:10:01 -0500 Received: from pm.sourcehosting.net (localhost [127.0.0.1]) by pm.sourcehosting.net (8.14.4/8.14.4) with ESMTP id q0NJuNpp040626 for ; Mon, 23 Jan 2012 14:56:23 -0500 (EST) (envelope-from glarkin@pm.sourcehosting.net) Received: (from glarkin@localhost) by pm.sourcehosting.net (8.14.4/8.14.4/Submit) id q0NJuNg8040625; Mon, 23 Jan 2012 14:56:23 -0500 (EST) (envelope-from glarkin) Message-Id: <201201231956.q0NJuNg8040625@pm.sourcehosting.net> Date: Mon, 23 Jan 2012 14:56:23 -0500 (EST) From: Greg Larkin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/164423: [PATCH] Pass MAKE_ENV to recursive make invocations in Mk/bsd.port.mk X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Greg Larkin List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 21:30:13 -0000 >Number: 164423 >Category: ports >Synopsis: [PATCH] Pass MAKE_ENV to recursive make invocations in Mk/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: Mon Jan 23 21:30:12 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Greg Larkin >Release: FreeBSD 8.2-RELEASE-p3 amd64 >Organization: The FreeBSD Project >Environment: System: FreeBSD pm.sourcehosting.net 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #0: Tue Sep 27 18:45:57 UTC 2011 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: bsd.port.mk contains several targets that recursively invoke make. If the top-level make was invoked with a user-specified MAKE_ENV, it is not passed to the recursive invocations. >How-To-Repeat: In order to configure a port and store the options file in a non-standard location, the config target can be invoked like so: cd /usr/ports/devel/git && \ make PORT_DBDIR=/tmp config The options file /tmp/git/options will be created in this example. If the port is configured recursively, both of the following commands place the options files in the standard /var/db/ports location: cd /usr/ports/devel/git && \ make PORT_DBDIR=/tmp config-recursive cd /usr/ports/devel/git && \ make MAKE_ENV+="PORT_DBDIR=/tmp" config-recursive >Fix: The attached patch invokes recursive make processes with the environment specified by the top-level MAKE_ENV variable. --- bsd.port.mk.recursive-make-env.diff begins here --- --- bsd.port.mk.orig 2012-01-16 17:34:21.000000000 -0500 +++ bsd.port.mk 2012-01-23 14:50:27.000000000 -0500 @@ -4329,18 +4329,18 @@ .if ${UID} != 0 && defined(_${target:U}_SUSEQ) && !defined(INSTALL_AS_USER) .if defined(USE_SUBMAKE) ${${target:U}_COOKIE}: ${_${target:U}_DEP} - @cd ${.CURDIR} && ${MAKE} ${_${target:U}_SEQ} + @cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} ${MAKE} ${_${target:U}_SEQ} .else ${${target:U}_COOKIE}: ${_${target:U}_DEP} ${_${target:U}_SEQ} .endif @${ECHO_MSG} "===> Switching to root credentials for '${target}' target" @cd ${.CURDIR} && \ - ${SU_CMD} "${MAKE} ${_${target:U}_SUSEQ}" + ${SU_CMD} "${SETENV} ${MAKE_ENV} ${MAKE} ${_${target:U}_SUSEQ}" @${ECHO_MSG} "===> Returning to user credentials" @${TOUCH} ${TOUCH_FLAGS} ${.TARGET} .elif defined(USE_SUBMAKE) ${${target:U}_COOKIE}: ${_${target:U}_DEP} - @cd ${.CURDIR} && \ + @cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} \ ${MAKE} ${_${target:U}_SEQ} ${_${target:U}_SUSEQ} @${TOUCH} ${TOUCH_FLAGS} ${.TARGET} .else @@ -4353,7 +4353,7 @@ @if [ -e ${.TARGET} ]; then \ ${DO_NADA}; \ else \ - cd ${.CURDIR} && ${MAKE} ${.TARGET}; \ + cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} ${MAKE} ${.TARGET}; \ fi .endif @@ -5263,14 +5263,14 @@ fetch-recursive: @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies" @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} fetch); \ + (cd $$dir; ${SETENV} ${MAKE_ENV} ${MAKE} fetch); \ done .endif .if !target(fetch-recursive-list) fetch-recursive-list: @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} fetch-list); \ + (cd $$dir; ${SETENV} ${MAKE_ENV} ${MAKE} fetch-list); \ done .endif @@ -5333,7 +5333,7 @@ checksum-recursive: @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies" @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} checksum); \ + (cd $$dir; ${SETENV} ${MAKE_ENV} ${MAKE} checksum); \ done .endif @@ -5458,7 +5458,7 @@ package-recursive: package @for dir in $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} package-noinstall); \ + (cd $$dir; ${SETENV} ${MAKE_ENV} ${MAKE} package-noinstall); \ done # Show missing dependencies @@ -6008,7 +6008,7 @@ config-recursive: @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies"; @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} config-conditional); \ + (cd $$dir; ${SETENV} ${MAKE_ENV} ${MAKE} config-conditional); \ done .endif @@ -6037,10 +6037,10 @@ shift 3; \ done; \ if [ "$${OPTIONS_INVALID}" = "yes" ]; then \ - cd ${.CURDIR} && ${MAKE} config; \ + cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} ${MAKE} config; \ fi; .else - cd ${.CURDIR} && ${MAKE} config; + cd ${.CURDIR} && ${SETENV} ${MAKE_ENV} ${MAKE} config; .endif .endif .endif @@ -6077,7 +6077,7 @@ showconfig-recursive: @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME} and dependencies"; @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} showconfig); \ + (cd $$dir; ${SETENV} ${MAKE_ENV} ${MAKE} showconfig); \ done .endif @@ -6104,7 +6104,7 @@ rmconfig-recursive: @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies"; @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} rmconfig); \ + (cd $$dir; ${SETENV} ${MAKE_ENV} ${MAKE} rmconfig); \ done .endif --- bsd.port.mk.recursive-make-env.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: