Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 439356 | Differences between
and this patch

Collapse All | Expand All

(-)portage-2.2.0_alpha160.orig/bin/isolated-functions.sh (-13 / +67 lines)
Lines 17-23 assert() { Link Here
17
	done
17
	done
18
}
18
}
19
19
20
__assert_sigpipe_ok() {
20
__helpers_assert_sigpipe_ok() {
21
	# When extracting a tar file like this:
21
	# When extracting a tar file like this:
22
	#
22
	#
23
	#     bzip2 -dc foo.tar.bz2 | tar xof -
23
	#     bzip2 -dc foo.tar.bz2 | tar xof -
Lines 32-46 __assert_sigpipe_ok() { Link Here
32
	# which says, "When a command terminates on a fatal
32
	# which says, "When a command terminates on a fatal
33
	# signal whose number is N, Bash uses the value 128+N
33
	# signal whose number is N, Bash uses the value 128+N
34
	# as the exit status."
34
	# as the exit status."
35
36
	local x pipestatus=${PIPESTATUS[*]}
35
	local x pipestatus=${PIPESTATUS[*]}
37
	for x in $pipestatus ; do
36
	for x in ${pipestatus} ; do
38
		# Allow SIGPIPE through (128 + 13)
37
		# Allow SIGPIPE through (128 + 13)
39
		[[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
38
		if [[ ${x} -ne 0 && ${x} -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] ; then
39
			__helpers_die "${FUNCNAME}: error ${x}: $*"
40
			return ${x}
41
		fi
40
	done
42
	done
41
43
42
	# Require normal success for the last process (tar).
44
	# Require normal success for the last process (tar).
43
	[[ $x -eq 0 ]] || die "$@"
45
	[[ ${x} -eq 0 ]] || __helpers_die "${FUNCNAME}: error ${x}: $*" || return ${x}
46
47
	return 0
44
}
48
}
45
49
46
shopt -s extdebug
50
shopt -s extdebug
Lines 92-119 nonfatal() { Link Here
92
		die "$FUNCNAME() not supported in this EAPI"
96
		die "$FUNCNAME() not supported in this EAPI"
93
	fi
97
	fi
94
	if [[ $# -lt 1 ]]; then
98
	if [[ $# -lt 1 ]]; then
95
		die "$FUNCNAME(): Missing argument"
99
		# Well they said nonfatal and forgot to finish their sentence.
100
		# Something ain't right, to be sure, but die()ing here seems a bit
101
		# pendantic and mean-spirited :)
102
		local phase_str=
103
		[[ -n ${EBUILD_PHASE} ]] && phase_str=" (${EBUILD_PHASE} phase)"
104
		eerror "ERROR: ${CATEGORY}/${PF}${phase_str}:"
105
		eerror "  ${FUNCNAME}: Missing argument"
106
		eerror
107
		return 1
96
	fi
108
	fi
97
109
98
	PORTAGE_NONFATAL=1 "$@"
110
	PORTAGE_NONFATAL=1 "$@"
99
}
111
}
100
112
113
# Memorizing the return-code at the beginning of __helpers_die()
114
# and returning it unchanged (unless it's 0) is intended as a
115
# courtesy to invokers who may use a bash sequence like:
116
#
117
#   failure_prone_action || \
118
#       __helpers_die "${FUNCNAME}: descriptive error message" || \
119
#           return $?
120
#
121
# as syntactic sugar for the following equivalent code:
122
#
123
#   failure_prone_action
124
#   ret=$?
125
#   if [[ ${ret} -ne 0 ]] ; then
126
#       __helpers_die "${FUNCNAME}: descriptive error message"
127
#       return ${ret}
128
#   fi
129
#
130
# However, beware: this trick will not work for positive
131
# conditionals because __helpers_die always returns a nonzero
132
# failure code (if it returns at all).  Neither
133
#
134
#   action_intended_to_fail && __helpers_die msg && return $?
135
#
136
# nor
137
#
138
#   action_intended_to_fail && __helpers_die msg || return $?
139
#
140
# will work as intended.  The following would be a clean, correct
141
# way to trigger __helpers_die() from a positive conditional:
142
#
143
#   action_intended_to_fail && {
144
#       __helpers_die "${FUNCNAME}: descriptive error message"
145
#       return 1
146
#   }
147
#
148
#   # NB: if this were the last command in your helper function, you
149
#   # should "return 0" here, as $? is always nonzero at this point.
150
#
101
__helpers_die() {
151
__helpers_die() {
102
	if ___eapi_helpers_can_die; then
152
	local retcode=$?
153
	(( retcode == 0 )) && retcode=1
154
155
	if ___eapi_helpers_can_die && [[ "${PORTAGE_NONFATAL:-0}" != 1 ]]; then
103
		die "$@"
156
		die "$@"
104
	else
157
	else
105
		echo -e "$@" >&2
158
		local phase_str=
159
		[[ -n ${EBUILD_PHASE} ]] && phase_str=" (${EBUILD_PHASE} phase)"
160
		ewarn "WARNING: ${CATEGORY}/${PF}${phase_str}:"
161
		ewarn "  ${FUNCNAME}: ${*:-(no error message)}"
162
		ewarn
106
	fi
163
	fi
164
165
	return "${retcode}"
107
}
166
}
108
167
109
die() {
168
die() {
110
	local IFS=$' \t\n'
169
	local IFS=$' \t\n'
111
170
112
	if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
113
		echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2
114
		return 1
115
	fi
116
117
	set +e
171
	set +e
118
	if [ -n "${QA_INTERCEPTORS}" ] ; then
172
	if [ -n "${QA_INTERCEPTORS}" ] ; then
119
		# die was called from inside inherit. We need to clean up
173
		# die was called from inside inherit. We need to clean up
(-)portage-2.2.0_alpha160.orig/bin/phase-helpers.sh (-50 / +76 lines)
Lines 94-99 insopts() { Link Here
94
	export INSOPTIONS="$@"
94
	export INSOPTIONS="$@"
95
95
96
	# `install` should never be called with '-s' ...
96
	# `install` should never be called with '-s' ...
97
	# FIXME: strip -s and call __helpers_die?
97
	has -s ${INSOPTIONS} && die "Never call insopts() with -s"
98
	has -s ${INSOPTIONS} && die "Never call insopts() with -s"
98
}
99
}
99
100
Lines 105-110 exeopts() { Link Here
105
	export EXEOPTIONS="$@"
106
	export EXEOPTIONS="$@"
106
107
107
	# `install` should never be called with '-s' ...
108
	# `install` should never be called with '-s' ...
109
	# FIXME: strip -s and call __helpers_die?
108
	has -s ${EXEOPTIONS} && die "Never call exeopts() with -s"
110
	has -s ${EXEOPTIONS} && die "Never call exeopts() with -s"
109
}
111
}
110
112
Lines 112-117 libopts() { Link Here
112
	export LIBOPTIONS="$@"
114
	export LIBOPTIONS="$@"
113
115
114
	# `install` should never be called with '-s' ...
116
	# `install` should never be called with '-s' ...
117
	# FIXME: strip -s and call __helpers_die?
115
	has -s ${LIBOPTIONS} && die "Never call libopts() with -s"
118
	has -s ${LIBOPTIONS} && die "Never call libopts() with -s"
116
}
119
}
117
120
Lines 154-165 keepdir() { Link Here
154
			| tr "\n" "\0" | \
157
			| tr "\n" "\0" | \
155
			while read -r -d $'\0' ; do
158
			while read -r -d $'\0' ; do
156
				>> "$REPLY" || \
159
				>> "$REPLY" || \
157
					die "Failed to recursively create .keep files"
160
					__helpers_die "Failed to recursively create .keep files" || \
161
						return $?
158
			done
162
			done
159
	else
163
	else
160
		for x in "$@"; do
164
		for x in "$@"; do
161
			>> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
165
			>> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
162
				die "Failed to create .keep in ${ED}${x}"
166
				__helpers_die "Failed to create .keep in ${ED}${x}" || \
167
					return $?
163
		done
168
		done
164
	fi
169
	fi
165
}
170
}
Lines 288-294 unpack() { Link Here
288
	local suffix
293
	local suffix
289
	local myfail
294
	local myfail
290
	local eapi=${EAPI:-0}
295
	local eapi=${EAPI:-0}
291
	[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
296
	[ -z "$*" ] && { __helpers_die "Nothing passed to the 'unpack' command" ; return 1 ; }
292
297
293
	for x in "$@"; do
298
	for x in "$@"; do
294
		__vecho ">>> Unpacking ${x} to ${PWD}"
299
		__vecho ">>> Unpacking ${x} to ${PWD}"
Lines 301-365 unpack() { Link Here
301
		if [[ ${x} == "./"* ]] ; then
306
		if [[ ${x} == "./"* ]] ; then
302
			srcdir=""
307
			srcdir=""
303
		elif [[ ${x} == ${DISTDIR%/}/* ]] ; then
308
		elif [[ ${x} == ${DISTDIR%/}/* ]] ; then
304
			die "Arguments to unpack() cannot begin with \${DISTDIR}."
309
			__helpers_die "Arguments to unpack() cannot begin with \${DISTDIR}."
310
			return 1
305
		elif [[ ${x} == "/"* ]] ; then
311
		elif [[ ${x} == "/"* ]] ; then
306
			die "Arguments to unpack() cannot be absolute"
312
			__helpers_die "Arguments to unpack() cannot be absolute"
313
			return 1
307
		else
314
		else
308
			srcdir="${DISTDIR}/"
315
			srcdir="${DISTDIR}/"
309
		fi
316
		fi
310
		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
317
		[[ -s ${srcdir}${x} ]] || __helpers_die "${x} does not exist" || return 1
311
318
312
		__unpack_tar() {
319
		__unpack_tar() {
313
			if [ "${y}" == "tar" ]; then
320
			if [ "${y}" == "tar" ]; then
314
				$1 -c -- "$srcdir$x" | tar xof -
321
				$1 -c -- "$srcdir$x" | tar xof -
315
				__assert_sigpipe_ok "$myfail"
322
				__helpers_assert_sigpipe_ok "$myfail" || return $?
316
			else
323
			else
317
				local cwd_dest=${x##*/}
324
				local cwd_dest=${x##*/}
318
				cwd_dest=${cwd_dest%.*}
325
				cwd_dest=${cwd_dest%.*}
319
				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
326
				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || \
327
					__helpers_die "$myfail" || return $?
320
			fi
328
			fi
321
		}
329
		}
322
330
323
		myfail="failure unpacking ${x}"
331
		myfail="failure unpacking ${x}"
324
		case "${suffix}" in
332
		case "${suffix}" in
325
			tar)
333
			tar)
326
				tar xof "$srcdir$x" || die "$myfail"
334
				tar xof "$srcdir$x" || __helpers_die "$myfail" || return $?
327
				;;
335
				;;
328
			tgz)
336
			tgz)
329
				tar xozf "$srcdir$x" || die "$myfail"
337
				tar xozf "$srcdir$x" || __helpers_die "$myfail" || return $?
330
				;;
338
				;;
331
			tbz|tbz2)
339
			tbz|tbz2)
332
				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
340
				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
333
				__assert_sigpipe_ok "$myfail"
341
				__helpers_assert_sigpipe_ok "$myfail" || return $?
334
				;;
342
				;;
335
			zip|jar)
343
			zip|jar)
336
				# unzip will interactively prompt under some error conditions,
344
				# unzip will interactively prompt under some error conditions,
337
				# as reported in bug #336285
345
				# as reported in bug #336285
338
				( set +x ; while true ; do echo n || break ; done ) | \
346
				( set +x ; while true ; do echo n || break ; done ) | \
339
				unzip -qo "${srcdir}${x}" || die "$myfail"
347
					unzip -qo "${srcdir}${x}" || \
348
						{ __helpers_die "$myfail" || return 1 ; }
340
				;;
349
				;;
341
			gz|z)
350
			gz|z)
342
				__unpack_tar "gzip -d"
351
				__unpack_tar "gzip -d" || return $?
343
				;;
352
				;;
344
			bz2|bz)
353
			bz2|bz)
345
				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
354
				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}" || \
355
					return $?
346
				;;
356
				;;
347
			7z)
357
			7z)
348
				local my_output
358
				local my_output
349
				my_output="$(7z x -y "${srcdir}${x}")"
359
				my_output="$(7z x -y "${srcdir}${x}")"
350
				if [ $? -ne 0 ]; then
360
				if [ $? -ne 0 ]; then
361
					local my_result=$?
351
					echo "${my_output}" >&2
362
					echo "${my_output}" >&2
352
					die "$myfail"
363
					__helpers_die "$myfail"
364
					return ${my_result}
353
				fi
365
				fi
354
				;;
366
				;;
355
			rar)
367
			rar)
356
				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
368
				unrar x -idq -o+ "${srcdir}${x}" || __helpers_die "$myfail" || return $?
357
				;;
369
				;;
358
			lha|lzh)
370
			lha|lzh)
359
				lha xfq "${srcdir}${x}" || die "$myfail"
371
				lha xfq "${srcdir}${x}" || __helpers_die "$myfail" || return $?
360
				;;
372
				;;
361
			a)
373
			a)
362
				ar x "${srcdir}${x}" || die "$myfail"
374
				ar x "${srcdir}${x}" || __helpers_die "$myfail" || return $?
363
				;;
375
				;;
364
			deb)
376
			deb)
365
				# Unpacking .deb archives can not always be done with
377
				# Unpacking .deb archives can not always be done with
Lines 369-399 unpack() { Link Here
369
				# installed.
381
				# installed.
370
				if type -P deb2targz > /dev/null; then
382
				if type -P deb2targz > /dev/null; then
371
					y=${x##*/}
383
					y=${x##*/}
372
					local created_symlink=0
384
					if [ ! "${srcdir}${x}" -ef "${y}" ] ; then
373
					if [ ! "$srcdir$x" -ef "$y" ] ; then
374
						# deb2targz always extracts into the same directory as
385
						# deb2targz always extracts into the same directory as
375
						# the source file, so create a symlink in the current
386
						# the source file, so create a symlink in the current
376
						# working directory if necessary.
387
						# working directory if necessary.
377
						ln -sf "$srcdir$x" "$y" || die "$myfail"
388
						ln -sf "${srcdir}${x}" "${y}" || \
378
						created_symlink=1
389
							__helpers_die "${myfail}" || return $?
379
					fi
390
						deb2targz "${y}" || \
380
					deb2targz "$y" || die "$myfail"
391
							__helpers_die "${myfail}" || return $?
381
					if [ $created_symlink = 1 ] ; then
382
						# Clean up the symlink so the ebuild
392
						# Clean up the symlink so the ebuild
383
						# doesn't inadvertently install it.
393
						# doesn't inadvertently install it.
384
						rm -f "$y"
394
						rm -f "${y}" || \
395
							__helpers_die "${myfail}" || return $?
396
					else
397
						deb2targz "${y}" || \
398
							__helpers_die "${myfail}" || return $?
385
					fi
399
					fi
386
					mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
400
					mv -f "${y%.deb}".tar.gz data.tar.gz || \
401
						__helpers_die "${myfail}" || return $?
387
				else
402
				else
388
					ar x "$srcdir$x" || die "$myfail"
403
					ar x "${srcdir}${x}" \
404
						|| __helpers_die "${myfail}" || return $?
389
				fi
405
				fi
390
				;;
406
				;;
391
			lzma)
407
			lzma)
392
				__unpack_tar "lzma -d"
408
				__unpack_tar "lzma -d" || return $?
393
				;;
409
				;;
394
			xz)
410
			xz)
395
				if ___eapi_unpack_supports_xz; then
411
				if ___eapi_unpack_supports_xz; then
396
					__unpack_tar "xz -d"
412
					__unpack_tar "xz -d" || return $?
397
				else
413
				else
398
					__vecho "unpack ${x}: file format not recognized. Ignoring."
414
					__vecho "unpack ${x}: file format not recognized. Ignoring."
399
				fi
415
				fi
Lines 405-412 unpack() { Link Here
405
	done
421
	done
406
	# Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
422
	# Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
407
	# should be preserved.
423
	# should be preserved.
408
	find . -mindepth 1 -maxdepth 1 ! -type l -print0 | \
424
	find . -mindepth 1 -maxdepth 1 ! -type l -execdir chmod -fR a+rX,u+w,g-w,o-w '{}' + || \
409
		${XARGS} -0 chmod -fR a+rX,u+w,g-w,o-w
425
		__helpers_die "${myfail}" || return $?
410
}
426
}
411
427
412
econf() {
428
econf() {
Lines 417-423 econf() { Link Here
417
	fi
433
	fi
418
434
419
	__hasg() {
435
	__hasg() {
420
		local x s=$1
436
		local x s="$1"
421
		shift
437
		shift
422
		for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
438
		for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
423
		return 1
439
		return 1
Lines 443-452 econf() { Link Here
443
		if [[ -n $CONFIG_SHELL && \
459
		if [[ -n $CONFIG_SHELL && \
444
			"$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
460
			"$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
445
			# preserve timestamp, see bug #440304
461
			# preserve timestamp, see bug #440304
446
			touch -r "$ECONF_SOURCE/configure" "$ECONF_SOURCE/configure._portage_tmp_.$$" || die
462
			touch -r "$ECONF_SOURCE/configure" "$ECONF_SOURCE/configure._portage_tmp_.$$" || \
463
				__helpers_die || return $?
447
			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
464
			sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
448
				die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
465
				__helpers_die "Substition of shebang in '$ECONF_SOURCE/configure' failed" || \
449
			touch -r "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die
466
					return $?
467
			touch -r "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || \
468
				__helpers_die "Failed to touch $ECONF_SOURCE/configure._portage_tmp_.$$" || \
469
					return $?
450
			rm -f "$ECONF_SOURCE/configure._portage_tmp_.$$"
470
			rm -f "$ECONF_SOURCE/configure._portage_tmp_.$$"
451
		fi
471
		fi
452
		if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
472
		if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
Lines 515-526 econf() { Link Here
515
				echo "!!! Please attach the following file when seeking support:"
535
				echo "!!! Please attach the following file when seeking support:"
516
				echo "!!! ${PWD}/config.log"
536
				echo "!!! ${PWD}/config.log"
517
			fi
537
			fi
518
			die "econf failed"
538
			__helpers_die "econf failed"
539
			return 1
519
		fi
540
		fi
520
	elif [ -f "${ECONF_SOURCE}/configure" ]; then
541
	elif [ -f "${ECONF_SOURCE}/configure" ]; then
521
		die "configure is not executable"
542
		__helpers_die "configure is not executable"
543
		return 1
522
	else
544
	else
523
		die "no configure script found"
545
		__helpers_die "no configure script found"
546
		return 1
524
	fi
547
	fi
525
}
548
}
526
549
Lines 562-570 einstall() { Link Here
562
			sysconfdir="${ED}etc" \
585
			sysconfdir="${ED}etc" \
563
			${LOCAL_EXTRA_EINSTALL} \
586
			${LOCAL_EXTRA_EINSTALL} \
564
			${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
587
			${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
565
			"$@" install || die "einstall failed"
588
			"$@" install || __helpers_die "einstall failed" || return $?
566
	else
589
	else
567
		die "no Makefile found"
590
		__helpers_die "no Makefile found"
591
		return 1
568
	fi
592
	fi
569
}
593
}
570
594
Lines 626-632 __eapi2_src_configure() { Link Here
626
650
627
__eapi2_src_compile() {
651
__eapi2_src_compile() {
628
	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
652
	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
629
		emake || die "emake failed"
653
		emake || __helpers_die "emake failed" || return $?
630
	fi
654
	fi
631
}
655
}
632
656
Lines 653-659 __eapi4_src_install() { Link Here
653
# @DESCRIPTION:
677
# @DESCRIPTION:
654
# Return true if given package is installed. Otherwise return false.
678
# Return true if given package is installed. Otherwise return false.
655
# Callers may override the ROOT variable in order to match packages from an
679
# Callers may override the ROOT variable in order to match packages from an
656
# alternative ROOT.
680
# alternative ROOT.  Note that we do not use __helpers_die here because
681
# a nonzero return value does not indicate failure.
657
has_version() {
682
has_version() {
658
683
659
	local atom eroot host_root=false root=${ROOT}
684
	local atom eroot host_root=false root=${ROOT}
Lines 667-673 has_version() { Link Here
667
692
668
	if ${host_root} ; then
693
	if ${host_root} ; then
669
		if ! ___eapi_best_version_and_has_version_support_--host-root; then
694
		if ! ___eapi_best_version_and_has_version_support_--host-root; then
670
			die "${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}"
695
			die ${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}
671
		fi
696
		fi
672
		root=/
697
		root=/
673
	fi
698
	fi
Lines 706-712 has_version() { Link Here
706
# @DESCRIPTION:
731
# @DESCRIPTION:
707
# Returns the best/most-current match.
732
# Returns the best/most-current match.
708
# Callers may override the ROOT variable in order to match packages from an
733
# Callers may override the ROOT variable in order to match packages from an
709
# alternative ROOT.
734
# alternative ROOT.  Note that we do not use __helpers_die here because in
735
# this case non-zero return values have nonfailing semantic significance.
710
best_version() {
736
best_version() {
711
737
712
	local atom eroot host_root=false root=${ROOT}
738
	local atom eroot host_root=false root=${ROOT}
Lines 758-764 if ___eapi_has_master_repositories; then Link Here
758
	master_repositories() {
784
	master_repositories() {
759
		local output repository=$1 retval
785
		local output repository=$1 retval
760
		shift
786
		shift
761
		[[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
787
		[[ $# -gt 0 ]] && { __helpers_die "${FUNCNAME[0]}: unused argument(s): $*" ; return 1 ; }
762
788
763
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
789
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
764
			"${PORTAGE_BIN_PATH}/ebuild-ipc" master_repositories "${EROOT}" "${repository}"
790
			"${PORTAGE_BIN_PATH}/ebuild-ipc" master_repositories "${EROOT}" "${repository}"
Lines 790-796 if ___eapi_has_repository_path; then Link Here
790
	repository_path() {
816
	repository_path() {
791
		local output repository=$1 retval
817
		local output repository=$1 retval
792
		shift
818
		shift
793
		[[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
819
		[[ $# -gt 0 ]] && { __helpers_die "${FUNCNAME[0]}: unused argument(s): $*" ; return 1 ; }
794
820
795
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
821
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
796
			"${PORTAGE_BIN_PATH}/ebuild-ipc" repository_path "${EROOT}" "${repository}"
822
			"${PORTAGE_BIN_PATH}/ebuild-ipc" repository_path "${EROOT}" "${repository}"
Lines 821-827 fi Link Here
821
if ___eapi_has_available_eclasses; then
847
if ___eapi_has_available_eclasses; then
822
	available_eclasses() {
848
	available_eclasses() {
823
		local output repository=${PORTAGE_REPO_NAME} retval
849
		local output repository=${PORTAGE_REPO_NAME} retval
824
		[[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
850
		[[ $# -gt 0 ]] && { __helpers_die "${FUNCNAME[0]}: unused argument(s): $*" ; return 1 ; }
825
851
826
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
852
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
827
			"${PORTAGE_BIN_PATH}/ebuild-ipc" available_eclasses "${EROOT}" "${repository}"
853
			"${PORTAGE_BIN_PATH}/ebuild-ipc" available_eclasses "${EROOT}" "${repository}"
Lines 853-859 if ___eapi_has_eclass_path; then Link Here
853
	eclass_path() {
879
	eclass_path() {
854
		local eclass=$1 output repository=${PORTAGE_REPO_NAME} retval
880
		local eclass=$1 output repository=${PORTAGE_REPO_NAME} retval
855
		shift
881
		shift
856
		[[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
882
		[[ $# -gt 0 ]] && { __helpers_die "${FUNCNAME[0]}: unused argument(s): $*" ; return 1 ; }
857
883
858
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
884
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
859
			"${PORTAGE_BIN_PATH}/ebuild-ipc" eclass_path "${EROOT}" "${repository}" "${eclass}"
885
			"${PORTAGE_BIN_PATH}/ebuild-ipc" eclass_path "${EROOT}" "${repository}" "${eclass}"
Lines 885-891 if ___eapi_has_license_path; then Link Here
885
	license_path() {
911
	license_path() {
886
		local license=$1 output repository=${PORTAGE_REPO_NAME} retval
912
		local license=$1 output repository=${PORTAGE_REPO_NAME} retval
887
		shift
913
		shift
888
		[[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
914
		[[ $# -gt 0 ]] && { __helpers_die "${FUNCNAME[0]}: unused argument(s): $*" ; return 1 ; }
889
915
890
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
916
		if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
891
			"${PORTAGE_BIN_PATH}/ebuild-ipc" license_path "${EROOT}" "${repository}" "${license}"
917
			"${PORTAGE_BIN_PATH}/ebuild-ipc" license_path "${EROOT}" "${repository}" "${license}"
(-)portage-2.2.0_alpha160.orig/bin/save-ebuild-env.sh (-1 / +1 lines)
Lines 46-52 __save_ebuild_env() { Link Here
46
	done
46
	done
47
	unset x
47
	unset x
48
48
49
	unset -f assert __assert_sigpipe_ok \
49
	unset -f assert __helpers_assert_sigpipe_ok \
50
		__dump_trace die \
50
		__dump_trace die \
51
		__quiet_mode __vecho __elog_base eqawarn elog \
51
		__quiet_mode __vecho __elog_base eqawarn elog \
52
		einfo einfon ewarn eerror ebegin __eend eend KV_major \
52
		einfo einfon ewarn eerror ebegin __eend eend KV_major \
(-)portage-2.2.0_alpha160.orig/doc/package/ebuild/eapi/4.docbook (-3 / +8 lines)
Lines 11-19 The dohard and dosed helpers from previo Link Here
11
<section id='package-ebuild-eapi-4-helpers-die-nonfatal'>
11
<section id='package-ebuild-eapi-4-helpers-die-nonfatal'>
12
<title>All helpers die on failure</title>
12
<title>All helpers die on failure</title>
13
<para>
13
<para>
14
All helpers now die automatically whenever some sort of error occurs.
14
All helpers now die automatically whenever any meaningful error occurs.
15
Helper calls may be prefixed with the 'nonfatal' helper in order
15
The 'nonfatal' helper may be used to effect the error-handling behavior
16
to prevent errors from being fatal.
16
of EAPIs 0-3, in which recoverable errors emit a warning and return
17
nonzero exit-codes to invokees.  It is used by prepending 'nonfatal' to any helper
18
invocation; for example, by replacing 'dodoc /foo.txt' with 'nonfatal dodoc /foo.txt'.
19
The 'nonfatal' helper should not be applied to
20
statements other than helper invocations, and has no effect on the 'die'
21
and 'assert' helpers.
17
</para>
22
</para>
18
</section>
23
</section>
19
<section id='package-ebuild-eapi-4-helpers-docompress'>
24
<section id='package-ebuild-eapi-4-helpers-docompress'>

Return to bug 439356