Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jun 2012 11:39:02 +0000
From:      scher@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r237765 - soc2012/scher/par_ports/head/Mk
Message-ID:  <20120615113902.17453106566B@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scher
Date: Fri Jun 15 11:39:01 2012
New Revision: 237765
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237765

Log:
  [docs]
  [new_feature] user configirable ${CHECK_ACTIVE_TIMEOUT}
  [fixed] ${MK} uses default umask when creating ${LOCK_DIR}
  

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	Fri Jun 15 10:38:14 2012	(r237764)
+++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk	Fri Jun 15 11:39:01 2012	(r237765)
@@ -14,6 +14,12 @@
 #								  matter what value is assigned.
 #								  Example: _parv_WANT_PARALLEL_BUILD=yes
 #
+# CHECK_ACTIVE_TIMEOUT			- timeout in seconds before next check of active
+#								  builds in case if port is prohibit to spawn
+#								  another background process. Consider that this
+#								  variable is also used in non-parallel build.
+#								  Default: 2
+#
 # _parv_WAIT_FOR_LOCK_TIME 		- time in seconds to wait if lock file is locked
 #								  by lockf(1) in case of directory locking.
 #								  Default: 5

Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk
==============================================================================
--- soc2012/scher/par_ports/head/Mk/bsd.port.mk	Fri Jun 15 10:38:14 2012	(r237764)
+++ soc2012/scher/par_ports/head/Mk/bsd.port.mk	Fri Jun 15 11:39:01 2012	(r237765)
@@ -1124,6 +1124,23 @@
 #				  has been specified in distinfo.  This is useful
 #				  when using an alternate FETCH_CMD.
 #
+############### PAR_PORTS SPECIFIC COMMENT LINE ############### 
+# Parallel ports build vriables
+# 
+# _parv_WANT_PARALLEL_BUILD 	
+#				- trigger for parallel ports installation. Set this variable to
+#				  some value to enable parallel ports build/install.
+#				  It does not matter what value is assigned.
+#				  Example: _parv_WANT_PARALLEL_BUILD=yes
+#
+# CHECK_ACTIVE_TIMEOUT
+#				- timeout in seconds before next check of active builds in case
+#				  if port is prohibit to spawn another background process.
+#				  Consider that this variable is also used in non-parallel build.
+#				  Default: 2
+#
+############### ENDF OF PAR_PORTS SPECIFIC COMMENT LINE  ###############
+#
 # End of the list of all variables that need to be defined in a port.
 # Most port authors should not need to understand anything after this point.
 #
@@ -1142,9 +1159,8 @@
 .include "${PORTSDIR}/Mk/bsd.commands.mk"
 
 ############### PAR_PORTS SPECIFIC COMMENT LINE ############### 
-# _parv_WANT_PARALLEL_BUILD    - assign this variable any value if port want to enable
-# parallel build/install features.
-#
+
+CHECK_ACTIVE_TIMEOUT?= 2
 
 .if defined(_parv_WANT_PARALLEL_BUILD)
 .include "${PORTSDIR}/Mk/bsd.parallel.mk"
@@ -1169,6 +1185,7 @@
 check-active-build-conflicts:
 	@${DO_NADA}
 .endif
+
 ############### ENDF OF PAR_PORTS SPECIFIC COMMENT LINE  ###############
 
 #
@@ -1518,7 +1535,7 @@
 .include "${PORTSDIR}/Mk/bsd.ncurses.mk"
 .endif
 
-############### PAR_PORTS SPECIFIC COMMENT LINE ############### 
+############### PAR_PORTS SPECIFIC COMMENT LINE ###############
 #
 .if defined(_parv_WANT_PARALLEL_BUILD) || !defined(IGNORE_PATH_CHECKS)
 .BEGIN:
@@ -1527,7 +1544,7 @@
 		${_dparv_START_OUTPUT}; \
 		${ECHO_CMD} "Creating lock dir"; \
 		${_dparv_END_OUTPUT}; \
-		${MKDIR} -m ${_parv_UMASK} ${LOCK_DIR}; \
+		${MKDIR} ${LOCK_DIR}; \
 	fi
 .		if ${_parv_IS_DEFAULT_TARGET}
 .			if defined(INSTALLS_DEPENDS)
@@ -5028,13 +5045,10 @@
 .endif
 
 ############### PAR_PORTS SPECIFIC COMMENT LINE ############### 
-# $${active_builds} - a list of "pid:path:dir[:target]" or "pid:lib:dir[:target]"
-# 		tuples of all currently processed ports, spawned by this make process 
-# $${notfound} codes : 0 - dep found
-#						1 - dep not found
-#						${_parv_ON_LOCK_EXIT_STATUS} - dep is locked
-# $${spawned} - sets to background process PID if any process was ran
-#		in background.
+#
+# $${spawned}	- sets to background process PID if any process was ran
+#				  in background.
+#
 ############### END OF PAR_PORTS SPECIFIC COMMENT LINE  ###############
 
 _INSTALL_DEPENDS=	\
@@ -5061,6 +5075,22 @@
 			(cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args 2>> $${log_file} >> $${log_file} ) & spawned=$$!; \
 		fi; \
 
+############### PAR_PORTS SPECIFIC COMMENT LINE ###############
+#
+# _PROCESS_ACTIVE_BUILDS	- this script contains all magic, related to
+#							  processing of background dependecy builds.
+#
+# $${builds_num}			- current number of spawned background dependecy
+#							  builds. If $${builds_num} < ${_parv_PARALLEL_BUILDS_NUMBER}
+#							  then another background dependency build will be
+#							  spawned, if there is any dependency to be spawned.
+#							  Otherwise "sleep ${CHECK_ACTIVE_TIMEOUT}" will be called.
+# $${active_builds} 		- a list of "pid:path:dir[:target]" or "pid:lib:dir[:target]"
+# 							  tuples of all currently being processed ports,
+#							  spawned by this make process.
+#
+############### END OF PAR_PORTS SPECIFIC COMMENT LINE  ###############
+
 _PROCESS_ACTIVE_BUILDS= \
 	echo "----   dependency output  ----- : --- ENTER _PROCESS_ACTIVE_BUILDS SECTION "; \
 	while true; do \
@@ -5116,11 +5146,29 @@
 		if { [ $${builds_num} -eq ${_parv_PARALLEL_BUILDS_NUMBER} ] || \
 			( [ $${builds_num} -gt 0 ] && [ $${\#depends} -eq 0 ] ); }; then \
 			echo "----   dependency output  ----- : CAN'T SPAWN MORE DEPS! SLEEP... "; \
-			sleep 2; \
+			sleep ${CHECK_ACTIVE_TIMEOUT}; \
 		fi; \
 	done; \
 	echo "----   dependency output  ----- : --- LEAVE _PROCESS_ACTIVE_BUILDS SECTION "
 
+############### PAR_PORTS SPECIFIC COMMENT LINE ###############
+#
+# _TERMINATE_PROCESS_TREE	- this script contains all magic, related to
+#							  terminating of the whole process tree, starting
+#							  from ${.MAKE.PID}.
+#							  This script implements Breadth-first traversal of
+#							  the process tree. It prevents processes of the
+#							  current level from evaluation of any commands using
+#							  STOP signal. Then it determines children of
+#							  processes of the current level of process tree
+#							  and stops them and so forth...
+#							  It is necessary to stop processes to avoid new
+#							  untracked pids. Finally, this script kills $${pids_to_kill}
+#							  
+# $${pids_to_kill}			- all pids of the process tree, starting from ${.MAKE.PID}
+# 
+############### END OF PAR_PORTS SPECIFIC COMMENT LINE  ###############
+
 _TERMINATE_PROCESS_TREE= \
 	${_dparv_START_OUTPUT}; \
 	${ECHO_CMD} Terminating process tree strating from ${.MAKE.PID}; \
@@ -5145,6 +5193,14 @@
 	${_dparv_START_OUTPUT}; \
 	/bin/kill -KILL $${pids_to_kill} 2> /dev/null || ${DO_NADA}
 
+############### PAR_PORTS SPECIFIC COMMENT LINE ############### 
+#
+# $${notfound} codes : 0 - dep found
+#					   1 - dep not found
+#					   ${_parv_ON_LOCK_EXIT_STATUS} - dep is locked
+#
+############### END OF PAR_PORTS SPECIFIC COMMENT LINE  ###############
+
 .for deptype in PKG EXTRACT PATCH FETCH BUILD RUN
 ${deptype:L}-depends:
 .if defined(${deptype}_DEPENDS)



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