build: Pick first field in ID_LIKE

CentOS Stream has:

ID_LIKE="rhel fedora"

which confused the existing script.  If there are multiple "likes"
arbitrarily pick the first one in the list.

Fixes: commit 63b722b6c0
This commit is contained in:
Richard W.M. Jones
2022-05-26 14:02:58 +01:00
parent 4b1fd3f154
commit 7afbf5ee44

View File

@@ -106,11 +106,11 @@ AC_ARG_WITH([distro],
cat /etc/os-release >&AS_MESSAGE_LOG_FD
DISTRO="$(
. /etc/os-release
if test -n "$ID_LIKE"; then
echo $ID_LIKE | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@'
else
echo $ID | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@'
fi
( if test -n "$ID_LIKE"; then
echo $ID_LIKE | $AWK '{print $1}'
else
echo $ID
fi ) | tr '@<:@:lower:@:>@' '@<:@:upper:@:>@'
)"
AS_CASE([$DISTRO],
[FEDORA | RHEL | CENTOS | ALMALINUX | CLOUDLINUX | ROCKY],