Check-in [0960f3ab3b]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:MFT: parallel_exec: Fix to not disable 'set -e' in child cmd due to || This set -e juggling is to keep this function portable to other scripts that may or may not be running set -e. This fixes compute_deps() finding invalid port origins and not properly stopping before the build starts, which can lead to infinite loops
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 3.0.x
Files: files | file ages | folders
SHA1: 0960f3ab3beb13209173f087f01eea081efaf0e4
User & Date: bdrewery 2013-06-23 12:03:51
Context
2013-06-23
12:04
MFT: jail/ports -u: Always try upgrading the SVN checkout before updating check-in: 97b3f76e8f user: bdrewery tags: 3.0.x
12:03
MFT: parallel_exec: Fix to not disable 'set -e' in child cmd due to || This set -e juggling is to keep this function portable to other scripts that may or may not be running set -e. This fixes compute_deps() finding invalid port origins and not properly stopping before the build starts, which can lead to infinite loops check-in: 0960f3ab3b user: bdrewery tags: 3.0.x
12:03
MFT: Quote filenames check-in: 30a0468a6d user: bdrewery tags: 3.0.x
Changes

Changes to src/share/poudriere/common.sh.

2199
2200
2201
2202
2203
2204
2205


2206












2207


2208
2209

2210
2211
2212
2213
2214
2215
2216
		echo ${LISTPORTS} | tr ' ' '\n'
	fi
}

parallel_exec() {
	local cmd="$1"
	local ret=0


	shift 1












	${cmd} "$@" || ret=1


	echo >&6 || :
	exit ${ret}

}

parallel_start() {
	local fifo

	if [ -n "${MASTERMNT}" ]; then
		fifo=${MASTERMNT}/poudriere/parallel.pipe







>
>

>
>
>
>
>
>
>
>
>
>
>
>
|
>
>


>







2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
		echo ${LISTPORTS} | tr ' ' '\n'
	fi
}

parallel_exec() {
	local cmd="$1"
	local ret=0
	local - # Make `set +e` local
	local errexit=0
	shift 1

	# Disable -e so that the actual execution failing does not
	# return early and prevent notifying the FIFO that the
	# exec is done
	case $- in *e*) errexit=1;; esac
	set +e
	(
		# Do still cause the actual command to return
		# non-zero if it has any failures, if caller
		# was set -e as well. Using 'if cmd' or 'cmd || '
		# here would disable set -e in the cmd execution
		[ $errexit -eq 1 ] && set -e
		${cmd} "$@"
	)
	ret=$?
	echo >&6 || :
	exit ${ret}
	# set -e will be restored by 'local -'
}

parallel_start() {
	local fifo

	if [ -n "${MASTERMNT}" ]; then
		fifo=${MASTERMNT}/poudriere/parallel.pipe