From 672a9a02845ff38db5228d7abcb424e5d2e5226b Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 6 Oct 2023 14:39:33 +0300 Subject: [PATCH] Make test-suite os detection stricter On Rocky Linux /etc/os-release contains not only ID="rocky", but also ID_LIKE="rhel centos fedora" and the grepping got that wrong. Let the shell do the work for us. Reported-by: Dmitry Mikushin --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 342b6c7e2b..ae33d59027 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,7 +5,7 @@ get_property(TOOLPROGS DIRECTORY ../tools PROPERTY BUILDSYSTEM_TARGETS) function(os_release var key) execute_process( - COMMAND sh -c "grep ^${key} /etc/os-release | cut -d= -f2" + COMMAND sh -c ". /etc/os-release; echo ${var}" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE value )