On 08/30/2017 08:02 PM, Mike Pagano wrote:
> As per PMS remove calls to external command 'tr' in global scope
> See bug #629106
> 
> Signed-off-by: Mike Pagano <mpag...@gentoo.org>
> ---
>  eclass/kernel-2.eclass | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
> index 09409ab1f..cdc8c4043 100644
> --- a/eclass/kernel-2.eclass
> +++ b/eclass/kernel-2.eclass
> @@ -1410,7 +1410,7 @@ getfilevar() {
> 
>  detect_arch() {
> 
> -   local ALL_ARCH LOOP_ARCH COMPAT_URI i
> +   local ALL_ARCH LOOP_ARCH COMPAT_URI TC_ARCH_KERNEL
> 
>     # COMPAT_URI is the contents of ${ARCH}_URI
>     # ARCH_URI is the URI for all the ${ARCH}_URI patches
> @@ -1418,6 +1418,7 @@ detect_arch() {
> 
>     ARCH_URI=""
>     ARCH_PATCH=""
> +   TC_ARCH_KERNEL=""
>     ALL_ARCH="ALPHA AMD64 ARM HPPA IA64 M68K MIPS PPC PPC64 S390 SH SPARC X86"
> 
>     for LOOP_ARCH in ${ALL_ARCH}; do
> @@ -1425,9 +1426,10 @@ detect_arch() {
>         COMPAT_URI="${!COMPAT_URI}"
> 
>         [[ -n ${COMPAT_URI} ]] && \
> -           ARCH_URI="${ARCH_URI} $(echo ${LOOP_ARCH} | tr '[:upper:]' 
> '[:lower:]')? ( ${COMPAT_URI} )"
> +           ARCH_URI="${ARCH_URI} ${LOOP_ARCH,,}? ( ${COMPAT_URI} )"
> 
> -       if [[ ${LOOP_ARCH} == "$(echo $(tc-arch-kernel) | tr '[:lower:]' 
> '[:upper:]')" ]];  then
> +       TC_ARCH_KERNEL=$(tc-arch-kernel); 
> +       if [[ ${LOOP_ARCH} == ${TC_ARCH_KERNEL^^} ]];   then
> 
> 

Unfortunately, the ${VAR,,} and ${VAR^^} forms were added in bash 4.0
[1], which means they are not available in EAPIs before 6, which only
allow constructs from bash 3.2 [2].

[1]: https://tiswww.case.edu/php/chet/bash/NEWS
[2]: https://projects.gentoo.org/pms/6/pms.html#x1-640006

-- 
Jonathan Callen

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to