In the appliance used to build the packages for openSUSE, os-release
is super minimal and only had ID_LIKE=suse. The code setting the
DISTRO variable only searches for ID variable so far, resulting in
invalid packagelist on openSUSE.
This fix reads ID_LIKE as a fallback if ID contains nothing.
---
m4/guestfs_appliance.m4 | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/m4/guestfs_appliance.m4 b/m4/guestfs_appliance.m4
index fbba3373f..ce45256bc 100644
--- a/m4/guestfs_appliance.m4
+++ b/m4/guestfs_appliance.m4
@@ -97,9 +97,15 @@ AC_MSG_CHECKING([which Linux distro for package names])
if test -f /etc/os-release; then
( . /etc/os-release && echo $ID | tr '@<:@:lower:@:>@'
'@<:@:upper:@:>@' ) >&AS_MESSAGE_LOG_FD
DISTRO="`. /etc/os-release && echo $ID | tr
'@<:@:lower:@:>@' '@<:@:upper:@:>@'`"
+ dnl when building SUSE-family packages, the OBS appliance has no ID in os-release,
+ dnl only ID_LIKE set to suse. Read ID_LIKE as a fallback if no ID is found.
+ if test -z "$DISTRO"; then
+ ( . /etc/os-release && echo $ID_LIKE | tr '@<:@:lower:@:>@'
'@<:@:upper:@:>@' ) >&AS_MESSAGE_LOG_FD
+ DISTRO="`. /etc/os-release && echo $ID_LIKE | tr
'@<:@:lower:@:>@' '@<:@:upper:@:>@'`"
+ fi
AS_CASE([$DISTRO],
[FEDORA | RHEL | CENTOS],[DISTRO=REDHAT],
- [OPENSUSE | SLED | SLES],[DISTRO=SUSE],
+ [OPENSUSE | SLED | SLES | SUSE],[DISTRO=SUSE],
[ARCH],[DISTRO=ARCHLINUX])
elif test -f /etc/debian_version; then
DISTRO=DEBIAN
--
2.13.2