kumquat-buildroot/support/scripts
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
..
apply-patches.sh
boot-qemu-image.py
br2-external br2-external: make version of external trees available 2023-05-13 12:06:08 +02:00
brpkgutil.py
check-bin-arch
check-dotconfig.py
check-host-rpath
check-kernel-headers.sh
check-merged-usr.sh
cpedb.py
cve.py
expunge-gconv-modules toolchain: support gconv modules from glibc >= 2.34 2022-10-21 21:02:40 +02:00
fix-configure-powerpc64.sh
fix-rpath support/scripts: fix fix-rpath 2023-08-07 23:20:31 +02:00
gen-bootlin-toolchains
gen-missing-cpe
generate-gitlab-ci-yml support/misc/gitlab-ci.yml.in: pass emulator builtin binaries as artifacts 2023-07-18 23:03:23 +02:00
genimage.sh
graph-build-time
graph-depends
hardlink-or-copy
mkmakefile
mkusers
pkg-stats support/scripts/pkg-stats: fix flake8 errors 2022-08-27 23:02:38 +02:00
pyinstaller.py
setlocalversion
size-stats support/scripts/size-stats: count compiled python (.pyc) files 2022-09-24 10:34:30 +02:00