Browse Source

Исправлено вычисление переменной ядра

tags/3.3.0.3
Mike Khiretskiy 6 years ago
parent
commit
648ff5154e
1 changed files with 17 additions and 10 deletions
  1. +17
    -10
      pym/update/variables/update.py

+ 17
- 10
pym/update/variables/update.py View File

@@ -1040,10 +1040,17 @@ class VariableClUpdateKernelSrcPath(ReadonlyVariable):
Каталог содержащий исходный код текущего ядра
"""
def get(self):
module_build_path = (
"/lib/modules/%s/build" % self.Get('cl_update_kernel_version'))
if path.exists(module_build_path):
return os.readlink(module_build_path)
kernel_ver = self.Get('cl_update_kernel_version')
for template_path in ("/lib/modules/%s/build",
"/usr/src/linux-%s"):
src_path = template_path % kernel_ver
if path.exists(src_path):
if path.islink(src_path):
return os.readlink(src_path)
else:
return src_path
else:
return ""


class VariableClUpdateKernelPkg(ReadonlyVariable):
@@ -1051,12 +1058,12 @@ class VariableClUpdateKernelPkg(ReadonlyVariable):
Пакет текущего ядра
"""
def get(self):
qfile = process('/usr/bin/qfile', '-vC',
self.Get('cl_update_kernel_src_path'))
if qfile.success():
return qfile.read().partition(" ")[0]
else:
return ""
src_path = self.Get('cl_update_kernel_src_path')
if src_path:
qfile = process('/usr/bin/qfile', '-vC', src_path)
if qfile.success():
return qfile.read().partition(" ")[0]
return ""


class VariableClUpdateLinesLimit(Variable):


Loading…
Cancel
Save