kernel-install: avoid process substitution

bash implements process substitution using /dev/fd/N (this is documented
in man bash). We'd like kernel-install to work in chrooted RPM
scriptlets without /dev.

We can use here-strings instead. bash uses temporary files to implement
those.
This commit is contained in:
Michal Schmidt
2017-01-11 15:34:54 -05:00
committed by Zbigniew Jędrzejewski-Szmek
parent 374e692252
commit db1e2bfc4f
+4 -4
View File
@@ -34,7 +34,7 @@ dropindirs_sort()
local -a files
local f d i
readarray -t files < <(
readarray -t files <<<"$(
for d in "$@"; do
for i in "$d/"*"$suffix"; do
if [[ -e "$i" ]]; then
@@ -42,7 +42,7 @@ dropindirs_sort()
fi
done
done | sort -Vu
)
)"
for f in "${files[@]}"; do
for d in "$@"; do
@@ -104,11 +104,11 @@ fi
ret=0
readarray -t PLUGINS < <(
readarray -t PLUGINS <<<"$(
dropindirs_sort ".install" \
"/etc/kernel/install.d" \
"/usr/lib/kernel/install.d"
)
)"
case $COMMAND in
add)