diff --git a/i18n/cl_builder_ru.mo b/i18n/cl_builder_ru.mo index 9d6b44b..5aefcc5 100644 Binary files a/i18n/cl_builder_ru.mo and b/i18n/cl_builder_ru.mo differ diff --git a/pym/cl_builder.py b/pym/cl_builder.py index f0bf9c5..f3a50c9 100644 --- a/pym/cl_builder.py +++ b/pym/cl_builder.py @@ -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: