Add check on full kernel sources.

master
Mike Hiretsky 12 years ago
parent 600ae910e3
commit b1d7579deb

@ -74,12 +74,23 @@ class cl_kernel(color_print):
"""Test directory for kernel sources"""
makefilepath = path.join(dirpath,'Makefile')
kbuildpath = path.join(dirpath,'Kbuild')
if not path.exists(makefilepath) \
or not path.exists(kbuildpath) \
or not "Kbuild for top-level directory of the kernel" in \
if path.exists(makefilepath) \
and path.exists(kbuildpath) \
and "Kbuild for top-level directory of the kernel" in \
open(kbuildpath,'r').read():
return False
return True
return True
return False
def _testFullKernelDirectory(self,dirpath):
"""To check the directory for full kernel sources
Kernel may be installed with minimal (later vmlinuz) flag"""
documentationPath = path.join(dirpath,'Documentation')
driversPath = path.join(dirpath,'drivers')
if path.exists(documentationPath) \
and path.exists(driversPath):
return True
return False
def setNoColor(self):
self.color = False

@ -125,8 +125,21 @@ class kernel_cmd(share_cmd):
if not self.logicObj._testKernelDirectory(values.k):
self.optobj.error("%s:'%s'"%
(_("wrong kernel source directory"),values.k))
elif not self.logicObj._testFullKernelDirectory(values.k):
self.optobj.error(("%s:'%s'"%
(_("in directory of kernel source not enough needed files"),
values.k))+"\n"+
_("Probably calculate-sources was "
"compiled with USE 'minimal'"))
else:
self.logicObj.clVars.Set('cl_kernel_src_path',values.k,True)
else:
if not self.logicObj._testFullKernelDirectory(
self.logicObj.clVars.Get('cl_kernel_src_path')):
self.optobj.error((_("in default directory of kernel source "
"not enough needed files")+"\n"+
_("Probably calculate-sources was "
"compiled with USE 'minimal'")))
if values.c and values.o:
self.optobj.error("%s: %s"%(_("incompatible options"),
self.getStringIncompatibleOptions(["c","o"])))

Loading…
Cancel
Save