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

develop 3.3.0.3
Mike Khiretskiy před 9 roky
rodič f1303ba0a8
revize 648ff5154e

@ -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):

Načítá se…
Zrušit
Uložit