Fix: OS detection
authorRomain Forlot <romain.forlot@iot.bzh>
Mon, 14 May 2018 13:11:51 +0000 (15:11 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Mon, 14 May 2018 13:14:45 +0000 (15:14 +0200)
Change-Id: Idcf5e85bfeab4edf1dbf52b6a0e3470ad350f939
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
cmake/common.cmake

index c6853ea..2f3bcdc 100644 (file)
@@ -42,7 +42,7 @@ endif()
 # Used to package .deb
 set(OS_RELEASE_PATH "${BUILD_ENV_SYSROOT}/etc/os-release")
 if(EXISTS ${OS_RELEASE_PATH})
-       execute_process(COMMAND bash "-c" "grep -E '^ID(_LIKE)?=' ${OS_RELEASE_PATH} | tail -n 1"
+       execute_process(COMMAND bash "-c" "grep -E '^ID(_LIKE)?=' /etc/os-release | tail -n 1 | sed -r 's:.*=\"(.*)\":\\1:' | awk '{print $1}'"
                OUTPUT_VARIABLE TMP_OSRELEASE
        )