Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP6
koan.13374
sles15.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sles15.patch of Package koan.13374
diff -urN koan-2.9.0.orig/koan/utils.py koan-2.9.0/koan/utils.py --- koan-2.9.0.orig/koan/utils.py 2017-10-19 13:10:16.000000000 +0200 +++ koan-2.9.0/koan/utils.py 2018-03-13 14:22:18.831313014 +0100 @@ -332,6 +332,13 @@ return lsb_release.get_distro_information()['ID'].lower() elif os.path.exists("/etc/SuSE-release"): return "suse" + elif os.path.exists("/etc/os-release"): + fh = open("/etc/os-release") + data = fh.read().lower() + if data.find("suse") != -1: + return "suse" + else: + return "redhat" else: # valid for Fedora and all Red Hat / Fedora derivatives return "redhat" @@ -372,14 +379,26 @@ make = "ubuntu" return (make, float(version)) elif check_dist() in ("suse", "opensuse"): - fd = open("/etc/SuSE-release") - for line in fd.read().split("\n"): - if line.find("VERSION") != -1: - version = line.replace("VERSION = ", "") - if line.find("PATCHLEVEL") != -1: - rest = line.replace("PATCHLEVEL = ", "") - make = "suse" - return (make, float(version)) + if os.path.exists("/etc/SuSE-release"): + fd = open("/etc/SuSE-release") + for line in fd.read().split("\n"): + if line.find("VERSION") != -1: + version = line.replace("VERSION = ", "") + if line.find("PATCHLEVEL") != -1: + rest = line.replace("PATCHLEVEL = ", "") + make = "suse" + return (make, float(version)) + elif os.path.exists("/etc/os-release"): + fd = open("/etc/os-release") + for line in fd.read().split("\n"): + if line.find("VERSION=") != -1: + version = line.replace("VERSION=", "").strip('"') + if line.find("PATCHLEVEL") != -1: + rest = line.replace("PATCHLEVEL=", "").strip('"') + make = "suse" + return (make, float(version)) + else: + return ("unknown", 0) else: return ("unknown", 0)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor