From owner-svn-soc-all@FreeBSD.ORG Thu Jun 28 18:16:42 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 0438D106564A for ; Thu, 28 Jun 2012 18:16:40 +0000 (UTC) (envelope-from scher@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Thu, 28 Jun 2012 18:16:40 +0000 Date: Thu, 28 Jun 2012 18:16:40 +0000 From: scher@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120628181640.0438D106564A@hub.freebsd.org> Cc: Subject: socsvn commit: r238488 - soc2012/scher/par_ports/head/Mk X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 18:16:42 -0000 Author: scher Date: Thu Jun 28 18:16:39 2012 New Revision: 238488 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238488 Log: [new_feature] Port does not goes into infinity non-sleeping loop if all deps are currently locked Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk soc2012/scher/par_ports/head/Mk/bsd.port.mk Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Thu Jun 28 17:15:16 2012 (r238487) +++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Thu Jun 28 18:16:39 2012 (r238488) @@ -465,6 +465,27 @@ fi; \ done +# TODO: docs needed +_parv_CHECK_ALL_DEPS_LOCKED= \ + if ! [ $${\#depends} -eq 0 ]; then \ + enable_feedback=${_parv_ON_LOCK_FEEDBACK_TIMEOUT}; \ + while true; do \ + for dep in $${depends}; do \ + dir=$${dep\#*:}; \ + { (cd $${dir}; ${MAKE} check-lock > /dev/null 2> /dev/null & wait $$! ) \ + && break 2 || continue; }; \ + done; \ + if [ $$(( $${enable_feedback} % ${_parv_ON_LOCK_FEEDBACK_TIMEOUT} )) -eq 0 ]; then \ + ${ECHO_CMD} "===> All dependencies are currently locked"; \ + ${ECHO_CMD} " Nothing to do"; \ + ${ECHO_CMD} " Waiting ..."; \ + enable_feedback=0; \ + fi; \ + enable_feedback=$$(( $${enable_feedback} + 1 )); \ + sleep ${_parv_CHECK_ACTIVE_TIMEOUT}; \ + done; \ + fi + # # _TERMINATE_PROCESS_TREE - this script contains all magic, related to # terminating of the whole process tree, starting Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk ============================================================================== --- soc2012/scher/par_ports/head/Mk/bsd.port.mk Thu Jun 28 17:15:16 2012 (r238487) +++ soc2012/scher/par_ports/head/Mk/bsd.port.mk Thu Jun 28 18:16:39 2012 (r238488) @@ -1512,6 +1512,7 @@ _PROCESS_ACTIVE_BUILDS?= ${DO_NADA} _parv_PRINT_ACTIVE_BUILDS?= ${DO_NADA} +_parv_CHECK_ALL_DEPS_LOCKED?= ${DO_NADA} .if !target(lock-port-dbdir) lock-port-dbdir: @@ -5247,6 +5248,7 @@ depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \ fi; \ fi; \ + ( ${_parv_CHECK_ALL_DEPS_LOCKED} ); \ ${_PROCESS_ACTIVE_BUILDS}; \ done .endif @@ -5334,6 +5336,7 @@ depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \ fi; \ fi; \ + ( ${_parv_CHECK_ALL_DEPS_LOCKED} ); \ ${_PROCESS_ACTIVE_BUILDS}; \ done .endif