socsvn commit: r238488 - soc2012/scher/par_ports/head/Mk

scher at FreeBSD.org scher at FreeBSD.org
Thu Jun 28 18:16:42 UTC 2012


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


More information about the svn-soc-all mailing list