Return the right osinfo short IDs for some rolling Linux distributions,
such as Arch Linux, Gentoo, and Void Linux. Their IDs were recently
added to osinfo-db.
---
inspector/expected-archlinux.img.xml | 1 +
lib/inspect-osinfo.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/inspector/expected-archlinux.img.xml b/inspector/expected-archlinux.img.xml
index b6c3b9c92..5906cf60f 100644
--- a/inspector/expected-archlinux.img.xml
+++ b/inspector/expected-archlinux.img.xml
@@ -10,6 +10,7 @@
<package_format>pacman</package_format>
<package_management>pacman</package_management>
<hostname>archlinux.test</hostname>
+ <osinfo>archlinux</osinfo>
<mountpoints>
<mountpoint dev="/dev/sda1">/</mountpoint>
</mountpoints>
diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c
index e0d19c672..51612bad1 100644
--- a/lib/inspect-osinfo.c
+++ b/lib/inspect-osinfo.c
@@ -59,6 +59,9 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root)
}
else if (STREQ (distro, "ubuntu"))
return safe_asprintf (g, "%s%d.%02d", distro, major, minor);
+ else if (STREQ (distro, "archlinux") || STREQ (distro, "gentoo")
+ || STREQ (distro, "voidlinux"))
+ return safe_strdup (g, distro);
if (major > 0 || minor > 0)
return safe_asprintf (g, "%s%d.%d", distro, major, minor);
--
2.20.1