|
|
|
@ -477,35 +477,31 @@ class cl_builder(color_print):
|
|
|
|
|
{'from':source,'to':target})
|
|
|
|
|
self.printByResult(True)
|
|
|
|
|
|
|
|
|
|
def setAssembleData(self,shortname,march):
|
|
|
|
|
def setAssembleData(self,newprofile):
|
|
|
|
|
"""Get assemble data from assemble.env"""
|
|
|
|
|
envData = iniParser(self.envFile)
|
|
|
|
|
if shortname == None and march == None:
|
|
|
|
|
if newprofile == None:
|
|
|
|
|
distros = self.clVars.Get('cl_builder_distro')
|
|
|
|
|
if len(distros) == 1:
|
|
|
|
|
section = distros[0].split(',')
|
|
|
|
|
var = 'os_assemble_linux_shortname'
|
|
|
|
|
shortname = \
|
|
|
|
|
_toUNICODE(envData.getVar(section,var)).encode('utf-8')
|
|
|
|
|
var = 'os_assemble_arch_machine'
|
|
|
|
|
march = \
|
|
|
|
|
_toUNICODE(envData.getVar(section,var)).encode('utf-8')
|
|
|
|
|
shortname = shortname.upper()
|
|
|
|
|
if shortname:
|
|
|
|
|
self.clVars.Set('os_builder_linux_shortname',shortname,True)
|
|
|
|
|
if march:
|
|
|
|
|
self.clVars.Set('os_builder_arch_machine',march,True)
|
|
|
|
|
newprofile = distros[0]
|
|
|
|
|
if not newprofile in self.clVars.Get('cl_builder_distro'):
|
|
|
|
|
if newprofile:
|
|
|
|
|
self.printERROR(_("wrong value for '--profile'"))
|
|
|
|
|
self.defaultPrint(_("Available assembled distro")+":\n")
|
|
|
|
|
for profile in self.clVars.Get('cl_builder_distro'):
|
|
|
|
|
self.printSUCCESS(profile)
|
|
|
|
|
return False
|
|
|
|
|
self.clVars.Set('os_builder_profile', newprofile, True)
|
|
|
|
|
self.assembleIso = True
|
|
|
|
|
section = (self.clVars.Get('os_builder_linux_shortname'),
|
|
|
|
|
self.clVars.Get('os_builder_arch_machine'))
|
|
|
|
|
self.clVars.Set('cl_builder_path', _toUNICODE(envData.getVar(section,
|
|
|
|
|
self.clVars.Set('cl_builder_path', _toUNICODE(envData.getVar(newprofile,
|
|
|
|
|
'cl_assemble_path')).encode('utf-8'),True)
|
|
|
|
|
linuxver = _toUNICODE(envData.getVar(section,
|
|
|
|
|
linuxver = _toUNICODE(envData.getVar(newprofile,
|
|
|
|
|
'os_assemble_linux_ver')).encode('utf-8')
|
|
|
|
|
if not linuxver:
|
|
|
|
|
curdate = datetime.now()
|
|
|
|
|
linuxver = "%04d%02d%02d"%(curdate.year,curdate.month,curdate.day)
|
|
|
|
|
self.clVars.Set('os_builder_linux_ver',linuxver ,True)
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def createPackageList(self,chrootdir,filename):
|
|
|
|
|
"""Create package list by chrootdir"""
|
|
|
|
|