diff --git a/pym/cl_builder.py b/pym/cl_builder.py index 1e6e927..3b5305a 100644 --- a/pym/cl_builder.py +++ b/pym/cl_builder.py @@ -22,7 +22,7 @@ import re import sys import traceback from os import path -from cl_utils import process,pathJoin,getRunCommands +from cl_utils import process,pathJoin,getRunCommands,getTupleVersion from subprocess import STDOUT,PIPE from cl_print import color_print from cl_datavars import DataVars @@ -264,8 +264,11 @@ class cl_builder(color_print): if path.realpath(self.clVars.Get('cl_builder_path')) == "/": self.printERROR(_("Source system should not be '/'")) return False - if self.clVars.Get('os_builder_linux_ver') == "0": - self.printERROR(_("Can not found distributive version")) + minver = "10.8" + if getTupleVersion(self.clVars.Get('os_builder_linux_ver')) < \ + getTupleVersion(minver): + self.printERROR(_("Command is supported for system not less version" + " %s") % minver ) return False elif not self.clVars.Get('os_builder_linux_shortname') in \ varsShare.dictNameSystem.keys(): diff --git a/pym/cl_image_cmd.py b/pym/cl_image_cmd.py index 5d2a24f..80050d6 100644 --- a/pym/cl_image_cmd.py +++ b/pym/cl_image_cmd.py @@ -94,6 +94,7 @@ class image_cmd(share_cmd): return True def createImagePaths(self): + """Create path, which contains images""" imagepath = self.logicObj.clVars.Get('cl_builder_image_path') if type(imagepath) != ListType: imagepath = [imagepath] @@ -103,3 +104,10 @@ class image_cmd(share_cmd): os.makedirs(pathname,mode=0755) except: pass + + def checkChrootStatus(self): + if self.logicObj.clVars.Get('cl_chroot_status') == 'off': + return True + else: + self.printERROR(_("This program can't be run from Scratch layer")) + return False diff --git a/scripts/cl-image b/scripts/cl-image index 50c6ce6..6df0ed3 100644 --- a/scripts/cl-image +++ b/scripts/cl-image @@ -39,6 +39,9 @@ if __name__ == "__main__": options, args = ret # set color/nocolor for display messages image.setPrintNoColor(options) + # check chroot status + if not image.checkChrootStatus(): + sys.exit(1) # set values to variables if not image.setVars(options): sys.exit(1)