Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2012 12:45:13 +0000
From:      scher@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r238332 - soc2012/scher/par_ports/head/Mk
Message-ID:  <20120626124513.4CBAA106564A@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scher
Date: Tue Jun 26 12:45:12 2012
New Revision: 238332
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238332

Log:
  [fixed] new execution flow for options checking.
  
  tmp file is used, to store already checked ports, to skip them later
  

Modified:
  soc2012/scher/par_ports/head/Mk/bsd.parallel.mk

Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk
==============================================================================
--- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk	Tue Jun 26 11:13:58 2012	(r238331)
+++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk	Tue Jun 26 12:45:12 2012	(r238332)
@@ -480,25 +480,35 @@
 
 #####################################################
 
+#####################################################
+# Parallel targets section
+# TODO: outline intergation with bsd.port.mk
+#
 locking-config-recursive: locking-config-message lock-port-dbdir config-recursive unlock-port-dbdir
 
 locking-config-message:
 	@${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
 
+# TODO: doc is needed
+_parv_CHECKED_CONFIG_F_PREFIX= already-checked-config
+
 config-recursive: config-conditional
-	@for dir in $$(${MAKE} run-depends-list build-depends-list | uniq); do \
-		while true; do \
-			( cd $$dir; ${MAKE} locking-config-recursive ) || { \
-				status=$$?; \
-				if [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \
-					sleep ${_parv_LOCK_ATTEMPT_TIMEOUT}; \
-					continue; \
-				else \
-					exit 1; \
-				fi; \
-			}; \
-			break; \
-		done; \
+	@if [ ! ${DEP_CHECK_CONFIG} ]; then \
+		already_checked_file=/tmp/${_parv_CHECKED_CONFIG_F_PREFIX}.${.MAKE.PID}; \
+		trap '${RM} -rf $${already_checked_file};' EXIT TERM INT; \
+		${ECHO_CMD} ${.CURDIR} > $${already_checked_file}; \
+	else \
+		already_checked_file=${DEP_CHECK_CONFIG}; \
+	fi; \
+	for dir in $$(${MAKE} run-depends-list build-depends-list | uniq); do \
+		if [ ! $$(grep $${dir}$$ $${already_checked_file}) ]; then \
+			${ECHO_CMD} configure options for $${dir}; \
+			( cd $${dir}; \
+			${MAKE} "DEP_CHECK_CONFIG=$${already_checked_file}" config-recursive ); \
+			${ECHO_CMD} $${dir} >> $${already_checked_file}; \
+		else \
+			${ECHO_CMD} $${dir} has been configed; \
+		fi; \
 	done
 
 check-lock:
@@ -550,4 +560,7 @@
 do-unlock:
 	@${DO_NADA}
 
+# End of Parallel targets section
+#####################################################
+
 .endif # !defined(_POSTMKINCLUDED) && !defined(Parallel_Pre_Include)



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