[Libguestfs] [supermin][PATCH] Fix rpm/zypper detection on openSUSE Tumbleweed

Felix Schnizlein felix at schnizle.in
Mon Sep 5 09:25:58 UTC 2016


Fix supermins rpm/zypper detection on openSUSE Tumbleweed

Newer version of openSUSE does not use /etc/SuSE-release anymore.
Search for the new /etc/SUSE-brand in addition.
---
diff --git a/src/rpm.ml b/src/rpm.ml
index a5dc67a..400efbd 100644
--- a/src/rpm.ml
+++ b/src/rpm.ml
@@ -39,7 +39,10 @@ let fedora_detect () =
 let opensuse_detect () =
   Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
     Config.zypper <> "no" &&
-    try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false
+    try
+      (stat "/etc/SuSE-release").st_kind = S_REG ||
+      (stat "/etc/SUSE-brand").st_kind = S_REG
+    with Unix_error _ -> false
 
 let mageia_detect () =
   Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&




More information about the Libguestfs mailing list