test-patches: allow to automatically determine flavour for rc and bpo kernels

This allows to detect the current flavour (here: "amd64") for an rc kernel
(here: $(uname -r) = 4.19.0-rc4-amd64). Also a bpo release is correctly
detected with this change.
This commit is contained in:
Uwe Kleine-König 2018-11-08 15:51:16 +01:00
parent 530b4e6298
commit f100f671db
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ shopt -s extglob
# Set defaults from the running kernel
arch="$(dpkg --print-architecture)"
kernelabi="$(uname -r)"
ff="${kernelabi#+([^-])-@(trunk|+([0-9]))-}"
ff="${kernelabi#+([^-])-@(trunk|?(rc)+([0-9])|+([0-9]).bpo.+([0-9]))-}"
if [ "x$ff" != "x$kernelabi" ]; then
flavour="${ff#@(openvz|rt|vserver|xen)-}"
if [ "x$flavour" != "x$ff" ]; then