Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: base-system@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] toolchain-glibc.eclass: Replace evar_* with local variables
Date: Fri, 24 Mar 2017 20:45:03
Message-Id: 20170324204446.23944-1-mgorny@gentoo.org
1 Use local variable to limit the scope of ABI variable override. This is
2 a builtin bash solution that is reliable and simple, unlike the complex
3 evar_* logic that unnecessarily pollutes global variables.
4 ---
5 eclass/toolchain-glibc.eclass | 4 +---
6 1 file changed, 1 insertion(+), 3 deletions(-)
7
8 diff --git a/eclass/toolchain-glibc.eclass b/eclass/toolchain-glibc.eclass
9 index d410775759df..365198303e8f 100644
10 --- a/eclass/toolchain-glibc.eclass
11 +++ b/eclass/toolchain-glibc.eclass
12 @@ -381,15 +381,13 @@ foreach_abi() {
13 else
14 abilist=${DEFAULT_ABI}
15 fi
16 - evar_push ABI
17 - export ABI
18 + local -x ABI
19 for ABI in ${abilist:-default} ; do
20 setup_env
21 einfo "Running $1 for ABI ${ABI}"
22 $1
23 : $(( ret |= $? ))
24 done
25 - evar_pop
26 return ${ret}
27 }
28
29 --
30 2.12.1

Replies