File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
+ # shellcheck disable=SC1117
4
+
3
5
# Ubuntu Kernel PPA info
4
6
ppa_host=" kernel.ubuntu.com"
5
7
ppa_index=" /~kernel-ppa/mainline/"
@@ -279,7 +281,6 @@ download () {
279
281
$wget -q --save-headers --output-document - " https://$host$uri "
280
282
else
281
283
exec 3<> /dev/tcp/" $host " /80
282
- # shellcheck disable=SC1117
283
284
echo -e " GET $uri HTTP/1.0\r\nHost: $host \r\nConnection: close\r\n\r\n" >&3
284
285
cat < & 3
285
286
fi
@@ -357,9 +358,7 @@ latest_local_version() {
357
358
358
359
if [ ${# LOCAL_VERSIONS[@]} -gt 0 ]; then
359
360
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)
363
362
364
363
lv=" ${sorted[${#sorted[@]} -1]}"
365
364
echo " ${lv/ -[0-9][0-9][0-9][0-9][0-9][0-9]rc/ -rc} "
@@ -404,8 +403,7 @@ latest_remote_version () {
404
403
load_remote_versions 1 " $1 "
405
404
local sorted
406
405
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)
409
407
echo " ${sorted[${#sorted[@]} -1]}"
410
408
}
411
409
You can’t perform that action at this time.
0 commit comments