Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, R0b0t1 <r030t1@×××××.com>
Subject: Re: [gentoo-portage-dev] Fix all misc. bash errors.
Date: Mon, 05 Feb 2018 04:45:26
Message-Id: 7d1a5c88-65ec-7102-0751-9a3b7dbd6501@gentoo.org
In Reply to: [gentoo-portage-dev] Fix all misc. bash errors. by R0b0t1
1 On 02/04/2018 07:22 PM, R0b0t1 wrote:
2 > This is everything that shellcheck reported as an error. They are not
3 > as serious as the globbing issue, but it would be a good idea to
4 > change them. They are generally "type" issues (e.g. ">" instead of
5 > "-gt").
6 >
7 > Some changes are shellcheck annotations. Very interesting was:
8 >
9 > eval "$x=(\"\${$x[@]}\" ${QA_PREBUILT//\*/.*})"
10 >
11 > Which looks like a bad array expansion ("$x[@]").
12
13 I don't see a shellcheck error for that, using shellcheck-0.4.7. Maybe a
14 false positive with an older version?
15
16 > diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
17 > index b28e44f18..377b32d90 100644
18 > --- a/bin/isolated-functions.sh
19 > +++ b/bin/isolated-functions.sh
20 > @@ -82,7 +82,7 @@ __dump_trace() {
21 > lineno=${BASH_LINENO[${n} - 1]}
22 > # Display function arguments
23 > args=
24 > - if [[ -n "${BASH_ARGV[@]}" ]]; then
25 > + if [[ -n "${BASH_ARGV[*]}" ]]; then
26
27 I feel like the shellcheck authors might be willing to accept [[ -n
28 ${BASH_ARGV[@]} ]] or [[ ${BASH_ARGV[@]} ]] as correct, since the
29 "Problematic code" that they cite involves an incorrect comparison:
30
31 https://github.com/koalaman/shellcheck/wiki/SC2199#problematic-code
32
33 I've merged all of your other changes. Thanks!
34 --
35 Thanks,
36 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-portage-dev] Fix all misc. bash errors. R0b0t1 <r030t1@×××××.com>