|
|
|
@ -23,7 +23,7 @@ from os import access, R_OK,W_OK
|
|
|
|
|
from os import path
|
|
|
|
|
from cl_distr import Distributive
|
|
|
|
|
from cl_utils import getTupleVersion,genpassword,pathJoin,_toUNICODE, \
|
|
|
|
|
getFilesCount,getCmdLineParam,countFiles
|
|
|
|
|
getFilesCount,getCmdLineParam,countFiles,listDirectory
|
|
|
|
|
from operator import itemgetter
|
|
|
|
|
from types import ListType
|
|
|
|
|
from cl_datavars import iniParser
|
|
|
|
@ -278,8 +278,23 @@ class fillVars(object, varsShare):
|
|
|
|
|
|
|
|
|
|
def get_os_builder_linux_filesnum(self):
|
|
|
|
|
"""Files number in image system"""
|
|
|
|
|
if self.Get('cl_builder_tree') == 'off':
|
|
|
|
|
sourceDirectory = self.Get('cl_builder_path')
|
|
|
|
|
portagePath = pathJoin(sourceDirectory,"usr/portage")
|
|
|
|
|
overlayPath = pathJoin(sourceDirectory,"var/lib/layman/calculate")
|
|
|
|
|
excludeCount = \
|
|
|
|
|
reduce(lambda x,y:x + y,
|
|
|
|
|
map(countFiles,
|
|
|
|
|
map(lambda x: path.join(sourceDirectory,"var/lib/layman/calculate",x),
|
|
|
|
|
filter(lambda x: not x in ("distfiles", "eclass", ".git","profiles"),
|
|
|
|
|
listDirectory(overlayPath))) + \
|
|
|
|
|
map(lambda x: path.join(sourceDirectory,"usr/portage",x),
|
|
|
|
|
filter(lambda x: not x in ("distfiles", "eclass", ".git","profiles"),
|
|
|
|
|
listDirectory(portagePath)))),0)
|
|
|
|
|
else:
|
|
|
|
|
excludeCount = 0
|
|
|
|
|
systemRoot = self.Get('cl_builder_path')
|
|
|
|
|
return str(countFiles(systemRoot))
|
|
|
|
|
return str(countFiles(systemRoot)-excludeCount)
|
|
|
|
|
|
|
|
|
|
def getVersionFromCalculateEnv(self,systemroot):
|
|
|
|
|
"""Get version from calculate ini"""
|
|
|
|
|