scripts/kernel-functions: Make this script compatible with bash versions that do not support readarray

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8900 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-05-11 20:37:43 +00:00
parent 9429a9930f
commit 056f426165
+7 -7
View File
@@ -553,14 +553,14 @@ EOF
function download_and_extract_distro_rpm {
[ -n "$1" ] || return $?
local arr
readarray -d ^ -t arr <<<"$1^^^^"
local kver=${arr[0]}
local distro=${arr[1]}
local release=${arr[2]}
set -- ${1//^/ }
local kver=$1
local distro=$2
local release=$3
(
cd "${kernel_downloads}" || exit $?
urls=($(get_srpm_urls "$distro" "$release" x86_64))
read -a urls -r <<<"$(get_srpm_urls "$distro" "$release" x86_64 |
tr '\n' ' ')"
for url in "${urls[@]}"; do
wget -q -nc "${url}/kernel-${kver}.src.rpm" && break
done
@@ -572,7 +572,7 @@ function download_and_extract_distro_rpm {
cd "${tmpdir}" &&
rpm2cpio "${kernel_downloads}/kernel-${kver}.src.rpm" |
cpio -i --make-directories --quiet &&
tar xaf linux-${kver}.tar.* &&
tar xaf "linux-${kver}.tar."* &&
mv "linux-${kver}" ".." &&
cd "../linux-${kver}"
) || return $?