Fine tuning the regex from discussion in the last pull

This commit is contained in:
Hin-Tak Leung 2023-08-02 02:07:04 +01:00
parent aaa2090dbf
commit 8f377d1eaa

View file

@ -78,11 +78,11 @@ function get_kernel_version() {
function check_kernel_headers() { function check_kernel_headers() {
VER_RUN=$(get_kernel_version) VER_RUN=$(get_kernel_version)
VER_HDR=$(dpkg -L raspberrypi-kernel-headers | egrep -m1 "/lib/modules/[[:print:]]+/build" | awk -F'/' '{ print $4; }') VER_HDR=$(dpkg -L raspberrypi-kernel-headers | egrep -m1 "/lib/modules/[^\/]+/build" | awk -F'/' '{ print $4; }')
[ "X$VER_RUN" == "X$VER_HDR" ] && { [ "X$VER_RUN" == "X$VER_HDR" ] && {
return 0 return 0
} }
VER_HDR=$(dpkg -L linux-headers-$VER_RUN | egrep -m1 "/lib/modules/[[:print:]]+/build" | awk -F'/' '{ print $4; }') VER_HDR=$(dpkg -L linux-headers-$VER_RUN | egrep -m1 "/lib/modules/[^\/]+/build" | awk -F'/' '{ print $4; }')
[ "X$VER_RUN" == "X$VER_HDR" ] && { [ "X$VER_RUN" == "X$VER_HDR" ] && {
return 0 return 0
} }