Skip to content

Commit 1426dc4

Browse files
committed
chore: fix shellcheck v5 issues
1 parent caab614 commit 1426dc4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ubuntu-mainline-kernel.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
# shellcheck disable=SC1117
4+
35
# Ubuntu Kernel PPA info
46
ppa_host="kernel.ubuntu.com"
57
ppa_index="/~kernel-ppa/mainline/"
@@ -279,7 +281,6 @@ download () {
279281
$wget -q --save-headers --output-document - "https://$host$uri"
280282
else
281283
exec 3<>/dev/tcp/"$host"/80
282-
# shellcheck disable=SC1117
283284
echo -e "GET $uri HTTP/1.0\r\nHost: $host\r\nConnection: close\r\n\r\n" >&3
284285
cat <&3
285286
fi
@@ -357,9 +358,7 @@ latest_local_version() {
357358

358359
if [ ${#LOCAL_VERSIONS[@]} -gt 0 ]; then
359360
local sorted
360-
IFS=$'\n'
361-
sorted=($(sort -t"." -k1V,3 <<<"${LOCAL_VERSIONS[*]}"))
362-
unset IFS
361+
mapfile -t sorted < <(echo "${LOCAL_VERSIONS[*]}" | tr ' ' '\n' | sort -t"." -k1V,3)
363362

364363
lv="${sorted[${#sorted[@]}-1]}"
365364
echo "${lv/-[0-9][0-9][0-9][0-9][0-9][0-9]rc/-rc}"
@@ -404,8 +403,7 @@ latest_remote_version () {
404403
load_remote_versions 1 "$1"
405404
local sorted
406405

407-
# shellcheck disable=SC2086
408-
sorted=($(echo ${REMOTE_VERSIONS[*]} | tr ' ' '\n' | sort -V | tr '\n' ' '))
406+
mapfile -t sorted < <(echo "${REMOTE_VERSIONS[*]}" | tr ' ' '\n' | sort -V)
409407
echo "${sorted[${#sorted[@]}-1]}"
410408
}
411409

0 commit comments

Comments
 (0)