Skip to content

Commit

Permalink
chore: fix shellcheck v5 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pimlie committed Apr 25, 2020
1 parent caab614 commit 1426dc4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ubuntu-mainline-kernel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# shellcheck disable=SC1117

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

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

lv="${sorted[${#sorted[@]}-1]}"
echo "${lv/-[0-9][0-9][0-9][0-9][0-9][0-9]rc/-rc}"
Expand Down Expand Up @@ -404,8 +403,7 @@ latest_remote_version () {
load_remote_versions 1 "$1"
local sorted

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

Expand Down

0 comments on commit 1426dc4

Please sign in to comment.