File virtinst-add-slm-detection-support.patch of Package virt-manager

Add support for detecting SUSE Linux Micro 6.0 and newer.
See also the osinfo-db package for the description file.
Note that starting with Micro version 6.0, the word "Enterprise" was
dropped from the Micro version name.

Index: virt-manager-4.1.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-4.1.0.orig/virtinst/install/urldetect.py
+++ virt-manager-4.1.0/virtinst/install/urldetect.py
@@ -271,13 +271,16 @@ class _SUSEContent(object):
                     ",", 1)[0].strip().rsplit(":")[4]
         distro_version = distro_version.strip()
 
-        if "Enterprise" in self.product_name or "SLES" in self.product_name:
+        if "Enterprise" in self.product_name or "SLES" in self.product_name or "Micro" in self.product_name:
             if " SAP " in self.product_name:
                 sle_version = self.product_name.strip().rsplit(' ')[7]
             if " High Performance " in self.product_name:
                 sle_version = self.product_name.strip().rsplit(' ')[6]
             else:
-                sle_version = self.product_name.strip().rsplit(' ')[4]
+                if "SUSE Linux Micro" in self.product_name:
+                    sle_version = self.product_name.strip().rsplit(' ')[3]
+                else:
+                    sle_version = self.product_name.strip().rsplit(' ')[4]
             if len(self.product_name.strip().rsplit(' ')) > 5 and not " Micro " in self.product_name:
                 if " SAP " in self.product_name:
                     sle_version = (sle_version + '.' +
@@ -708,6 +711,14 @@ class _MICRODistro(_SuseDistro):
     famregex = ".*SUSE Linux Enterprise Micro.*"
 
 
+class _SLMICRODistro(_SuseDistro):
+    PRETTY_NAME = "SLES"
+    matching_distros = ["slm"]
+    _variant_prefix = "slm"
+    _suse_regex = [".*SUSE Linux Micro*", ".*SUSE Micro*"]
+    famregex = ".*SUSE Linux Micro.*"
+
+
 class _CAASPDistro(_SuseDistro):
     PRETTY_NAME = "SLES"
     matching_distros = ["caasp"]
@@ -977,6 +988,7 @@ def _build_distro_list(osobj):
         _SLEDDistro,
         _OpensuseDistro,
         _MICRODistro,
+        _SLMICRODistro,
         _CAASPDistro,
         _OESDistro,
         _DebianDistro,
openSUSE Build Service is sponsored by