diff --git a/pym/update/update.py b/pym/update/update.py index e3aa40d..e55b395 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -764,7 +764,6 @@ class Update(MethodsInterface): _("Listing packages for removal"))) self._display_pretty_package_list(pkglist, remove_list=True) - def mark_schedule(self): """ Установить отметку о запуске запланированной проверки @@ -772,7 +771,11 @@ class Update(MethodsInterface): SystemIni(self.clVars).setVar('system', {'last_check': str(int(time.time()))}) def get_default_emerge_opts(self): - return self.clVars.Get('cl_emerge_default_opts') + if self.clVars.GetBool('cl_update_with_bdeps_set'): + bdeps = " --with-bdeps=y" + else: + bdeps = " --with-bdeps=n" + return self.clVars.Get('cl_emerge_default_opts') + bdeps def premerge(self, param, *packages): """ @@ -1219,6 +1222,14 @@ class Update(MethodsInterface): location="system") return True + def save_with_bdeps(self): + oldval = self.clVars.Get('cl_update_with_bdeps_set') + newval = self.clVars.Get('cl_update_with_bdeps_opt_set') + if oldval != newval: + self.clVars.Write('cl_update_with_bdeps_set', newval, + location="system") + return True + def message_binhost_changed(self): if self.refresh_binhost: self.printWARNING(_("Update server was changed to %s") % diff --git a/pym/update/utils/cl_update.py b/pym/update/utils/cl_update.py index 1d93313..e1da361 100644 --- a/pym/update/utils/cl_update.py +++ b/pym/update/utils/cl_update.py @@ -71,6 +71,10 @@ class ClUpdateAction(Action): interruptMessage = __("Update manually interrupted") emerge_tasks = [ + {'name': 'save_bdeps_val', + 'method': 'Update.save_with_bdeps()', + 'essential': False + }, {'name': 'premerge_group', 'group': __("Checking for updates"), 'tasks': [ diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index e6534f4..b5c9651 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -1729,3 +1729,26 @@ class VariableClUpdatePackageCacheSet(Variable): except ValueError: return "on" return "on" + + +class VariableClUpdateWithBdepsSet(Variable): + """ + Добавление --with-bdeps при вызове emerge + """ + type = "bool" + value = "off" + + +class VariableClUpdateWithBdepsOptSet(Variable): + """ + Добавление --with-bdeps при вызове emerge (опция) + """ + type = "bool" + opt = ["--with-bdeps"] + + def init(self): + self.help = _("Save packages used during build") + self.label = _("save packages used during build") + + def get(self): + return self.Get('cl_update_with_bdeps_set') diff --git a/pym/update/wsdl_update.py b/pym/update/wsdl_update.py index 7467141..0cccec0 100644 --- a/pym/update/wsdl_update.py +++ b/pym/update/wsdl_update.py @@ -67,6 +67,7 @@ class Wsdl(WsdlBase): normal=( 'cl_update_binhost_stable_opt_set', 'cl_update_binhost_recheck_set', + 'cl_update_with_bdeps_opt_set' ), expert=( 'cl_update_sync_only_set',