From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH v2] eclass/kernel-2.eclass: Remove use of tr in global scope
Date: Thu, 31 Aug 2017 19:27:10 +0200 [thread overview]
Message-ID: <1504200430.15812.2.camel@gentoo.org> (raw)
In-Reply-To: <20170831163355.GA11483@woodpecker.gentoo.org>
W dniu czw, 31.08.2017 o godzinie 12∶33 -0400, użytkownik Mike Pagano
napisał:
> As per PMS remove calls to external command 'tr' in global scope See bug #629106.
Closes: https://bugs.gentoo.org/629106
(assuming you want the bug closed)
>
> Signed-off-by: Mike Pagano <mpagano@gentoo.org>
> ---
> eclass/kernel-2.eclass | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
> index 09409ab1f..205ea93d5 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 LOOP_ARCH_L COMPAT_URI i TC_ARCH_KERNEL
>
> # COMPAT_URI is the contents of ${ARCH}_URI
> # ARCH_URI is the URI for all the ${ARCH}_URI patches
> @@ -1418,20 +1418,25 @@ 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
> COMPAT_URI="${LOOP_ARCH}_URI"
> COMPAT_URI="${!COMPAT_URI}"
>
> + declare -l LOOP_ARCH_L=${LOOP_ARCH}
> +
> [[ -n ${COMPAT_URI} ]] && \
> - ARCH_URI="${ARCH_URI} $(echo ${LOOP_ARCH} | tr '[:upper:]' '[:lower:]')? ( ${COMPAT_URI} )"
> + ARCH_URI="${ARCH_URI} ${LOOP_ARCH_L}? ( ${COMPAT_URI} )"
>
> - if [[ ${LOOP_ARCH} == "$(echo $(tc-arch-kernel) | tr '[:lower:]' '[:upper:]')" ]]; then
> + declare -u TC_ARCH_KERNEL=$(tc-arch-kernel);
Strictly speaking, you shouldn't use tc-arch-kernel in global scope
either since it depends on CHOST. However, we can live with it for now.
Also, didn't you accidentally add a trailing space there?
> + if [[ ${LOOP_ARCH} == ${TC_ARCH_KERNEL} ]]; then
Missing newline? Tab in middle of the line looks weird.
> for i in ${COMPAT_URI}; do
> ARCH_PATCH="${ARCH_PATCH} ${DISTDIR}/${i/*\//}"
> done
> fi
> +
> done
> }
>
Besides those minor nits, +1.
--
Best regards,
Michał Górny
next prev parent reply other threads:[~2017-08-31 17:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 16:33 [gentoo-dev] [PATCH v2] eclass/kernel-2.eclass: Remove use of tr in global scope Mike Pagano
2017-08-31 17:27 ` Michał Górny [this message]
2017-08-31 18:11 ` Mike Pagano
2017-08-31 18:53 ` Walter Dnes
2017-08-31 19:05 ` Mike Gilbert
2017-08-31 17:51 ` Ulrich Mueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504200430.15812.2.camel@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox