build: set OS_ID_LIKE only if unset 50/37050/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 31 Aug 2022 09:45:17 +0000 (11:45 +0200)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 1 Sep 2022 12:53:15 +0000 (12:53 +0000)
cmake MATCHES directive with the empty regex "" always match, including
non-empty strings.

Type: fix
Fixes: 534dfc1f18db74f4a2c78d62fe6893daba56dc86

Change-Id: If085b29da15a6d7fc680cebb823183fd3c7eea68
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/cmake/pack.cmake

index f4edecb..88b6254 100644 (file)
@@ -65,7 +65,7 @@ macro(add_vpp_packaging)
   set(CPACK_${type}_PACKAGE_RELEASE 1)
 
   # Pure Debian does not set the "OS_ID_LIKE", it only sets "OS_ID"
-  if (OS_ID_LIKE MATCHES "")
+  if (NOT DEFINED OS_ID_LIKE)
     set(OS_ID_LIKE "${OS_ID}")
   endif()