[Libguestfs] [PATCH 2/5] inspect: detect Gentoo from os-release

Pino Toscano ptoscano at redhat.com
Tue Apr 2 12:56:27 UTC 2019


Add "gentoo" as recognized ID in /etc/os-release, and consider it as
rolling distribution (so without VERSION_ID in os-release).

This avoids using a not-useful version read from /etc/gentoo-release,
e.g. "Gentoo Base System release 2.6".
---
 daemon/inspect_fs_unix.ml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml
index 8b7096d30..84283546b 100644
--- a/daemon/inspect_fs_unix.ml
+++ b/daemon/inspect_fs_unix.ml
@@ -62,7 +62,7 @@ let arch_binaries =
  * features.
  *)
 let rolling_distros =
-  [ DISTRO_VOID_LINUX ]
+  [ DISTRO_GENTOO; DISTRO_VOID_LINUX ]
 
 (* Parse a os-release file.
  *
@@ -142,6 +142,7 @@ and distro_of_os_release_id = function
   | "debian" -> Some DISTRO_DEBIAN
   | "fedora" -> Some DISTRO_FEDORA
   | "frugalware" -> Some DISTRO_FRUGALWARE
+  | "gentoo" -> Some DISTRO_GENTOO
   | "kali" -> Some DISTRO_KALI_LINUX
   | "mageia" -> Some DISTRO_MAGEIA
   | "neokylin" -> Some DISTRO_NEOKYLIN
-- 
2.20.1




More information about the Libguestfs mailing list