# - Red Hat Linux 9
# - Mandrake Linux 10.1
# - Scientific Linux 3.0.5
+ # - Mandriva 2006.0
data = open("/etc/redhat-release").readline()
res = re.search(r'(.*)[L|l]inux.*release\s+([\d.]*)', data)
if res:
# - Debian 3.1
plt_name = "Debian"
plt_ver = open("/etc/debian_version").readline().strip()
- _xml_file_name = "config_%s_%s.xml"%(plt_name, plt_ver)
- if plt_name and plt_ver and os.path.exists("%s/%s"%(cur_dir, _xml_file_name)):
- xml_file_name = _xml_file_name
- elif os.path.exists("/etc/mandriva_release"):
- # - Mandriva 2006
- plt_name = "Mandriva"
- plt_ver = open("/etc/mandriva_release").readline().strip()
+ elif os.path.exists("/etc/mandriva-release"):
+ # - Mandriva 2006 (an additional check if above check fails)
+ data = open("/etc/mandriva-release").readline()
+ res = re.search(r'(.*)[L|l]inux.*release\s+([\d.]*)', data)
+ if res:
+ plt_name = "".join(res.group(1).split())
+ plt_ver = res.group(2)
_xml_file_name = "config_%s_%s.xml"%(plt_name, plt_ver)
if plt_name and plt_ver and os.path.exists("%s/%s"%(cur_dir, _xml_file_name)):
xml_file_name = _xml_file_name