* [gentoo-portage-dev] [PATCH 11/13] Add tentative EAPI6 nonfatal support to die()
@ 2014-08-18 17:56 99% ` Michał Górny
0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2014-08-18 17:56 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Michał Górny
Add support for die() to respect 'nonfatal' modifier if
'--respect-nonfatal' (or '-n') option is used. This allows eclasses
to create custom ebuild helpers that mimic built-in helper behavior.
---
bin/eapi.sh | 4 ++++
bin/isolated-functions.sh | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6716b1c..c650a4c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -166,6 +166,10 @@ ___eapi_unpack_supports_absolute_paths() {
[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
}
+___eapi_die_can_respect_nonfatal() {
+ [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
# OTHERS
___eapi_enables_failglob_in_global_scope() {
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index d41f0b3..f9bc90d 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -116,6 +116,13 @@ __helpers_die() {
die() {
local IFS=$' \t\n'
+ if ___eapi_die_can_respect_nonfatal; then
+ if [[ ${1} == -n || ${1} == --respect-nonfatal ]]; then
+ [[ ${PORTAGE_NONFATAL} == 1 ]] && return 1
+ shift
+ fi
+ fi
+
set +e
if [ -n "${QA_INTERCEPTORS}" ] ; then
# die was called from inside inherit. We need to clean up
--
2.0.4
^ permalink raw reply related [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-08-18 17:56 [gentoo-portage-dev] [PATCHES] Initial EAPI6 patch set for review Michał Górny
2014-08-18 17:56 99% ` [gentoo-portage-dev] [PATCH 11/13] Add tentative EAPI6 nonfatal support to die() Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox