Fix detection of SLE15-SP1

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=439
This commit is contained in:
Charles Arnold 2018-10-31 19:34:02 +00:00 committed by Git OBS Bridge
parent 686ee09506
commit d125800c6b

View File

@ -4,7 +4,30 @@ Index: virt-manager-2.0.0/virtinst/urldetect.py
===================================================================
--- virt-manager-2.0.0.orig/virtinst/urldetect.py
+++ virt-manager-2.0.0/virtinst/urldetect.py
@@ -630,6 +630,13 @@ class SuseDistro(Distro):
@@ -606,6 +606,10 @@ class SuseDistro(Distro):
if re.search("openSUSE Tumbleweed", self.cache.treeinfo_name):
return "opensusetumbleweed"
+ sp_version = False
+ if ' SP' in self.cache.treeinfo_version:
+ sp_version = True
+ self.cache.treeinfo_version = self.cache.treeinfo_version.replace(' SP', '.')
version, update = self.cache.split_version()
base = self._variant_prefix + str(version)
while update >= 0:
@@ -613,7 +617,10 @@ class SuseDistro(Distro):
# SLE doesn't use '.0' for initial releases in
# osinfo-db (sles11, sles12, etc)
if update > 0 or not base.startswith('sle'):
- tryvar += ".%s" % update
+ if sp_version:
+ tryvar += "sp%s" % update
+ else:
+ tryvar += ".%s" % update
if OSDB.lookup_os(tryvar):
return tryvar
update -= 1
@@ -630,6 +637,13 @@ class SuseDistro(Distro):
return "install"