mcst-linux-kernel/patches-2024.06.26/python-stdlib-extensions-2..../0003-bug-110351-added-getti...

38 lines
1.1 KiB
Diff

From f7a83bfab57d46a6e547d2c2e9d093ffdae69404 Mon Sep 17 00:00:00 2001
Date: Fri, 14 Dec 2018 19:24:10 +0300
Subject: [PATCH] bug 110351: added getting distribution information
---
Lib/platform.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Lib/platform.py b/Lib/platform.py
index 55f2fa8..0f36fdf 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -202,6 +202,21 @@ def _dist_try_harder(distname,version,id):
Slackware Linux distributions.
"""
+ if os.path.exists('/etc/mcst_version'):
+ distname = 'Elbrus'
+ id = 'elbrus'
+ # Read the first line
+ f = open('/etc/mcst_version', 'r')
+ firstline = f.readline()
+ f.close()
+ # Take the first two words
+ l = string.split(string.strip(firstline))
+ if len(l) == 2:
+ version = l[1]
+ elif l:
+ version = l[0]
+ return distname, version, id
+
if os.path.exists('/var/adm/inst-log/info'):
# SuSE Linux stores distribution information in that file
info = open('/var/adm/inst-log/info').readlines()
--
2.16.4