Fix detection of OS

The previous method broke on ubuntu, where the value of ID was not quoted in
`/etc/os-release`. This broke tests that depended on paths set on known OSes.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-02-03 17:59:08 -07:00
parent 2e1466fc7e
commit abc3a0ee2d

View File

@@ -1,7 +1,7 @@
-include Defaults.mk -include Defaults.mk
# Linux distro (try and set to /etc/os-release ID) # Linux distro (try and set to /etc/os-release ID)
OS_REL := $(shell sed -n "s/^ID\s*=\s*['"\""]\(.*\)['"\""]/\1/p" /etc/os-release) OS_REL := $(shell sh -c '. /etc/os-release; echo $ID')
OS ?= $(OS_REL) OS ?= $(OS_REL)
ARCH_REL := $(shell uname -p) ARCH_REL := $(shell uname -p)