Fix check ablility run cl-image and cl-kernel command.

master
Mike Hiretsky 13 years ago
parent b71c994b0c
commit bb085d613e

Binary file not shown.

@ -156,14 +156,16 @@ class fillVars(object, varsShare):
def get_cl_builder_path(self):
"""Get path for image"""
paths = map(lambda x:x[1],reversed(libData.cl_env_data['value']))
for inifile in paths:
if os.access(inifile,os.R_OK):
inidata = iniParser(inifile)
res = inidata.getVar("assemble","cl_assemble_path",
checkExistVar=True)
if res[0]:
return _toUNICODE(res[1]).encode('utf-8')
return "/mnt/builder"
if self.Get('cl_action') != 'kernel':
for inifile in paths:
if os.access(inifile,os.R_OK):
inidata = iniParser(inifile)
res = inidata.getVar("assemble","cl_assemble_path",
checkExistVar=True)
if res[0]:
return _toUNICODE(res[1]).encode('utf-8')
return "/mnt/builder"
return "/"
def get_cl_builder_kernel(self):
"""Kernel image"""

@ -78,14 +78,15 @@ class image_cmd(share_cmd):
def isScratch(self,showError=True):
"""Detect scartch system"""
if not path.exists(self.envFile) \
if not os.access(self.envFile,os.R_OK) \
or not self.logicObj.clVars.Get('cl_builder_path'):
if self.logicObj.clVars.Get('os_scratch') == 'on':
return True
else:
if showError:
self.printERROR(
_("You should load system in the builder mode"))
_("You should load system in the builder mode") + " "
+ _("or have to assemble system"))
return False
return False
@ -128,6 +129,10 @@ class image_cmd(share_cmd):
if not self.logicObj.setAssembleData(values.p,values.v):
sys.exit(1)
if not self.logicObj.clVars.Get('cl_builder_distro'):
if not self.isRoot() or not self.isScratch(True):
sys.exit(1)
if values.notree:
self.logicObj.clVars.Set('cl_builder_tree','off',True)

@ -113,6 +113,7 @@ class kernel_cmd(share_cmd):
"""Check values all specified options."""
if len(args) > 0:
self.optobj.error(_("unrecognized option") + ": %s"% "".join(args))
self.logicObj.clVars.Set('cl_action',"kernel",True)
if values.ebuild:
self.checkEnviromentForEbuild()
if values.initrd:

Loading…
Cancel
Save