Add support for leanos which is equivalent to SLE15

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=363
This commit is contained in:
Charles Arnold 2017-09-11 22:24:03 +00:00 committed by Git OBS Bridge
parent babbbf68b4
commit 000254c033

View File

@ -22,7 +22,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
+ pbuf = fetcher.acquireFileContent("media.1/products").rsplit('/', 1)[1].strip()
+ # Older style products format: SUSE-Linux-Enterprise-Server-11-SP4 11.4.4-1.109
+ # Newer style products format: SLES12-SP3 12.3-0
+ if pbuf.startswith('SLE'):
+ if pbuf.startswith('SLE') or pbuf.startswith('leanos'):
+ pbuf = pbuf.split(' ')[0]
+ pbuf = " ".join(re.split('(\d+)', pbuf, 1))
+ cbuf = "\nDISTRO ," + pbuf.replace('-', ' ')
@ -33,16 +33,17 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
distribution = None
distro_version = None
@@ -465,7 +478,7 @@ def _distroFromSUSEContent(fetcher, arch
@@ -465,7 +478,8 @@ def _distroFromSUSEContent(fetcher, arch
dclass = GenericDistro
if distribution:
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
- re.match(".*SUSE SLES*", distribution[1]):
+ re.match(".*SUSE SLES*", distribution[1]) or re.match("SLES*", distribution[1]):
+ re.match(".*SUSE SLES*", distribution[1]) or re.match("SLES*", distribution[1]) or \
+ re.match("leanos*", distribution[1]):
dclass = SLESDistro
if distro_version is None:
distro_version = _parse_sle_distribution(distribution)
@@ -481,7 +494,7 @@ def _distroFromSUSEContent(fetcher, arch
@@ -481,7 +495,7 @@ def _distroFromSUSEContent(fetcher, arch
dclass = CAASPDistro
if distro_version is None:
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]]
@ -51,7 +52,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
dclass = OpensuseDistro
if distro_version is None:
distro_version = ['VERSION', distribution[0].strip().rsplit(':')[4]]
@@ -1040,8 +1053,11 @@ class SuseDistro(Distro):
@@ -1040,8 +1054,11 @@ class SuseDistro(Distro):
self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch,
"boot/%s/initrd-xenpae" % self.arch)]
else: