|
|
|
@ -93,6 +93,7 @@ class cl_builder(color_print):
|
|
|
|
|
self.force = False
|
|
|
|
|
self.assembleIso = False
|
|
|
|
|
self.envFile = '/etc/calculate/assemble.env'
|
|
|
|
|
self.curProfile = None
|
|
|
|
|
|
|
|
|
|
def setNoColor(self):
|
|
|
|
|
self.color = False
|
|
|
|
@ -226,6 +227,37 @@ class cl_builder(color_print):
|
|
|
|
|
distrPath = distr.convertToDirectory().getDirectory()
|
|
|
|
|
self.cleanNeedlessKernelData(distrPath)
|
|
|
|
|
self.applyTemplatesForSquash(distrPath)
|
|
|
|
|
# change make.profile
|
|
|
|
|
builderPath = self.clVars.Get('cl_builder_path')
|
|
|
|
|
curProfileFile = pathJoin(builderPath,"etc/make.profile")
|
|
|
|
|
self.curProfile = os.readlink(curProfileFile)
|
|
|
|
|
profile = self.clVars.Get('os_builder_profile')
|
|
|
|
|
newProfile = None
|
|
|
|
|
if not self.curProfile.endswith(profile):
|
|
|
|
|
if profile.startswith("calculate"):
|
|
|
|
|
newProfile = path.join("../var/lib/layman/calculate/profiles",
|
|
|
|
|
profile)
|
|
|
|
|
else:
|
|
|
|
|
newProfile = path.join("../usr/portage/profiles",
|
|
|
|
|
profile)
|
|
|
|
|
os.unlink(curProfileFile)
|
|
|
|
|
os.symlink(newProfile,curProfileFile)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def restoreProfile(self):
|
|
|
|
|
"""Restore profile"""
|
|
|
|
|
if not self.curProfile:
|
|
|
|
|
return
|
|
|
|
|
self.printMessageForTest(_("Restore system profile"))
|
|
|
|
|
builderPath = self.clVars.Get('cl_builder_path')
|
|
|
|
|
curProfileFile = pathJoin(builderPath,"etc/make.profile")
|
|
|
|
|
profile = self.clVars.Get('os_builder_profile')
|
|
|
|
|
newProfile = None
|
|
|
|
|
if not self.curProfile.endswith(profile):
|
|
|
|
|
os.unlink(curProfileFile)
|
|
|
|
|
os.symlink(self.curProfile,curProfileFile)
|
|
|
|
|
self.curProfile = None
|
|
|
|
|
self.printByResult(True)
|
|
|
|
|
|
|
|
|
|
def isoPrepacking(self,directory):
|
|
|
|
|
self.printByResult(True)
|
|
|
|
@ -541,6 +573,7 @@ class cl_builder(color_print):
|
|
|
|
|
self.printByResult(True)
|
|
|
|
|
if self.assembleIso:
|
|
|
|
|
self.restoreMount()
|
|
|
|
|
self.restoreProfile()
|
|
|
|
|
except (BuilderError,DistributiveError),e:
|
|
|
|
|
error = "%s\n%s" % (str(error),_("Unmounting error"))
|
|
|
|
|
except KeyboardInterrupt,e:
|
|
|
|
|