-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathci-precompiled-helpers.sh
More file actions
31 lines (30 loc) · 1.2 KB
/
ci-precompiled-helpers.sh
File metadata and controls
31 lines (30 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
get_kernel_versions_to_test() {
if [[ "$#" -lt 4 || "$#" -gt 5 ]]; then
echo " Error:$0 must be called with KERNEL_FLAVORS DRIVER_BRANCHES DIST LTS_KERNEL or KERNEL_FLAVORS DRIVER_BRANCHES DIST LTS_KERNEL PLATFORM_SUFFIX" >&2
exit 1
fi
local -a KERNEL_FLAVORS=("${!1}")
local -a DRIVER_BRANCHES=("${!2}")
local DIST="$3"
local LTS_KERNEL="$4"
local PLATFORM_SUFFIX="$5"
kernel_versions=()
for kernel_flavor in "${KERNEL_FLAVORS[@]}"; do
for DRIVER_BRANCH in "${DRIVER_BRANCHES[@]}"; do
source ./tests/scripts/findkernelversion.sh "${kernel_flavor}" "$DRIVER_BRANCH" "$DIST" "$LTS_KERNEL" "$PLATFORM_SUFFIX" >&2
if [[ "$should_continue" == true ]]; then
break
fi
done
if [[ "$should_continue" == true ]]; then
KERNEL_VERSION=$(echo "$KERNEL_VERSION" | tr -d ' \n')
kernel_versions+=("$KERNEL_VERSION")
fi
done
# Remove duplicates
kernel_versions=($(printf "%s\n" "${kernel_versions[@]}" | sort -u))
for i in "${!kernel_versions[@]}"; do
kernel_versions[$i]="${kernel_versions[$i]}-$DIST$PLATFORM_SUFFIX"
done
echo "${kernel_versions[@]}"
}