From 648ff5154e88d21b84bfb4b9927ee1f8737ca09b Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Wed, 11 Feb 2015 09:08:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=B2=D1=8B=D1=87=D0=B8=D1=81=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D1=8F=D0=B4=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/variables/update.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 8317352..5bc4b15 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -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):