From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Dec 15 15:10:04 2009 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 45D88106568B for ; Tue, 15 Dec 2009 15:10:04 +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 07D008FC1E for ; Tue, 15 Dec 2009 15:10:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFFA3Cr050641 for ; Tue, 15 Dec 2009 15:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nBFFA3JA050640; Tue, 15 Dec 2009 15:10:03 GMT (envelope-from gnats) Resent-Date: Tue, 15 Dec 2009 15:10:03 GMT Resent-Message-Id: <200912151510.nBFFA3JA050640@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, Andrius Morkunas Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70D46106566C for ; Tue, 15 Dec 2009 15:07:13 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 5F9E48FC15 for ; Tue, 15 Dec 2009 15:07:13 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nBFF7DQD049894 for ; Tue, 15 Dec 2009 15:07:13 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id nBFF7DXY049893; Tue, 15 Dec 2009 15:07:13 GMT (envelope-from nobody) Message-Id: <200912151507.nBFF7DXY049893@www.freebsd.org> Date: Tue, 15 Dec 2009 15:07:13 GMT From: Andrius Morkunas To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/141641: [patch] make 'config-recursive' finish in one pass X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 15:10:04 -0000 >Number: 141641 >Category: ports >Synopsis: [patch] make 'config-recursive' finish in one pass >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: Tue Dec 15 15:10:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Andrius Morkunas >Release: >Organization: >Environment: >Description: Config recursive needs multiple passes to configure all dependencies in some cases. Situation is similar with rmconfig-recursive. More info here: http://lists.freebsd.org/pipermail/freebsd-ports/2009-December/058175.html Attached patch fixes these problems. >How-To-Repeat: Enable options that add new dependencies during config-recursive and do config-recursive again. >Fix: Patch attached with submission follows: --- Mk/bsd.port.mk.orig 2009-11-26 00:02:29.000000000 +0200 +++ Mk/bsd.port.mk 2009-12-09 21:18:03.873125530 +0200 @@ -6073,9 +6073,36 @@ .if !target(config-recursive) 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); \ + @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies"; \ + ${MAKE} config-conditional; \ + L=$$(${MAKE} -V _DEPEND_DIRS); \ + checked=""; \ + while [ -n "$$L" ]; do \ + l=""; \ + for d in $$L; do \ + case $$checked in \ + $$d\ *|*\ $$d\ *|*\ $$d) \ + continue;; \ + esac; \ + checked="$$checked $$d"; \ + if [ ! -d $$d ]; then \ + ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- recursive config incomplete" >&2; \ + continue; \ + fi; \ + ${MAKE} -C $$d config-conditional; \ + if ! children=$$(cd $$d && ${MAKE} -V _DEPEND_DIRS); then \ + ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- recursive config incomplete" >&2; \ + continue; \ + fi; \ + for child in $$children; do \ + case "$$checked $$l" in \ + $$child\ *|*\ $$child\ *|*\ $$child) \ + continue;; \ + esac; \ + l="$$l $$child"; \ + done; \ + done; \ + L=$$l; \ done .endif @@ -6169,12 +6196,56 @@ .if !target(rmconfig-recursive) rmconfig-recursive: - @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies"; - @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ - (cd $$dir; ${MAKE} rmconfig); \ + @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies"; \ + L=${.CURDIR}; \ + checked=""; \ + while [ -n "$$L" ]; do \ + l=""; \ + for d in $$L; do \ + case $$checked in \ + $$d\ *|*\ $$d\ *|*\ $$d) \ + continue;; \ + esac; \ + checked="$$checked $$d"; \ + if [ ! -d $$d ]; then \ + ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- recursive rmconfig incomplete" >&2; \ + continue; \ + fi; \ + if ! children=$$(${MAKE} -C $$d -V _DEPEND_DIRS); then \ + ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- recursive rmconfig incomplete" >&2; \ + continue; \ + fi; \ + if (${MAKE} -C $$d rmconfig-internal > /dev/null); then \ + ${ECHO_MSG} "===> Removing user-configured options for `${MAKE} -C $$d -V PKGNAME`"; \ + children="$${children} $$(${MAKE} -C $$d -V _DEPEND_DIRS)"; \ + else \ + ${ECHO_MSG} "===> No user-specified options configured for `${MAKE} -C $$d -V PKGNAME`"; \ + fi; \ + for child in $$children; do \ + case "$$checked $$l" in \ + $$child\ *|*\ $$child\ *|*\ $$child) \ + continue;; \ + esac; \ + l="$$l $$child"; \ + done; \ + done; \ + L=$$l; \ done .endif +# This should only be used by rmconfig-recursive. +.if !target(rmconfig-internal) +rmconfig-internal: +.if defined(OPTIONS) && exists(${OPTIONSFILE}) + -@${ECHO_CMD}; \ + optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \ + ${RM} -f ${OPTIONSFILE}; \ + ${RMDIR} $${optionsdir}; +.else + exit 1; +.endif +.endif + desktop-categories: @categories=""; \ for native_category in ${CATEGORIES}; do \ >Release-Note: >Audit-Trail: >Unformatted: