kumquat-buildroot/support
Yann E. MORIN 3b7c7e6106 support/scripts: fix fix-rpath
Commit 134900401f (support/scripts/fix-rpath: parallelize patching
files) broke the rpath fixup, because it improperly quoted or expanded
variables:

  - $@ was expanded in the main() context, rather than in the sub-bash
    as expected, propagating incorrect parameters to patch_file();

  - an array was passed without array expansion, so only the first item
    was passed; that was in turn assigned to a string, anyway loosign
    the array. Liuckily, we only ever put a single item in that array,
    so that worked by chance.

We fix that by inverting the parameters to patch_elf(), where the extra
args are passed last, so we can put as many we want in the future. We
also pass every variables as positional parameters outside the bash -c
command, which allows us proper quoting of all variables, specifically
of the extra args array which now comes last.

The ultralong line was split, too, in a hopefully easier-to-read form.

Fixing all that also required fixing the many shellcheck issues at the
same time (wome were pre-existing before 134900401f).

While at it, expand two TABs into spaces like the rest of the script.

Note: shellcheck does not seem to warn when a variable expansion will be
used as the command to run, i.e. ${PATCHELF} does not trigger the
quoting error. Still, for consistency, we also double-quote it (we know
it is a single word, as it is already double-quoted once in the script).

Fixes: 134900401f

Cc: Victor Dumas <dumasv.dev@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2023-08-07 23:20:31 +02:00
..
config-fragments support/config-fragments/autobuild/br-arm-internal-glibc: update to bleeding edge components 2023-05-21 17:52:14 +02:00
dependencies support/dependencies/dependencies.sh: require IPC::Cmd perl package for libopenssl 2023-07-18 22:41:31 +02:00
docker support/docker: use APT::Retries in apt-get calls to retry 2023-02-07 18:14:59 +01:00
download support/download: add support to exclude svn externals 2023-08-06 16:35:52 +02:00
gnuconfig support/gnuconfig: fix previous version bump 2020-09-27 18:30:05 +02:00
kconfig support/kconfig: fix compiler warnings 2021-10-06 21:11:09 +02:00
legal-info boot, package, support, toolchain: switch to 2 spaces for the hash file 2022-07-28 23:05:23 +02:00
libtool
misc support/misc/gitlab-ci.yml.in: pass emulator builtin binaries as artifacts 2023-07-18 23:03:23 +02:00
scripts support/scripts: fix fix-rpath 2023-08-07 23:20:31 +02:00
testing support/testing: TestLxc switch to the Arm Bootlin toolchain 2023-08-02 21:18:10 +02:00