|
|
|
@ -281,11 +281,31 @@ class fillVars(object, varsShare):
|
|
|
|
|
systemRoot = self.Get('cl_builder_path')
|
|
|
|
|
return str(countFiles(systemRoot))
|
|
|
|
|
|
|
|
|
|
def getVersionFromCalculateEnv(self,systemroot):
|
|
|
|
|
"""Get version from calculate ini"""
|
|
|
|
|
pathname = path.join(systemroot,
|
|
|
|
|
'var/lib/layman/calculate/profiles/calculate.env')
|
|
|
|
|
if path.exists(pathname):
|
|
|
|
|
FD = open(pathname)
|
|
|
|
|
data = FD.readlines()
|
|
|
|
|
FD.close()
|
|
|
|
|
verList = filter(lambda y:y,
|
|
|
|
|
map(lambda x:\
|
|
|
|
|
len(x.split("="))==2 and\
|
|
|
|
|
x.split("=")[0].strip() == "os_linux_ver" and\
|
|
|
|
|
x.split("=")[1].strip(), data))
|
|
|
|
|
if verList:
|
|
|
|
|
reVer=re.compile("^((\d+\.)*\d|\d+)$",re.S)
|
|
|
|
|
reRes = filter(reVer.search,verList)
|
|
|
|
|
if reRes:
|
|
|
|
|
return reRes[0]
|
|
|
|
|
|
|
|
|
|
def get_os_builder_linux_ver(self):
|
|
|
|
|
"""Build system ver"""
|
|
|
|
|
linuxShortName = self.Get("os_builder_linux_shortname")
|
|
|
|
|
rootSystem = self.Get('cl_builder_path')
|
|
|
|
|
return self.getVersionFromMetapackage(rootSystem,linuxShortName) or \
|
|
|
|
|
self.getVersionFromCalculateEnv(rootSystem) or \
|
|
|
|
|
self.getVersionFromCalculateIni(rootSystem) or \
|
|
|
|
|
self.getVersionFromGentooFiles(rootSystem) or "0"
|
|
|
|
|
|
|
|
|
|