From 20695d85139666b28fcd33fc6bb0683e65d89cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Mon, 13 Mar 2017 12:43:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=20--w?= =?UTF-8?q?ith-bdeps=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=B7=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D0=B9=D1=81=D1=82=D0=B2=D0=BE=D0=B2=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit обновление пакетов необходимых для сборки --- pym/update/update.py | 15 +++++++++++++-- pym/update/utils/cl_update.py | 4 ++++ pym/update/variables/update.py | 23 +++++++++++++++++++++++ pym/update/wsdl_update.py | 1 + 4 files changed, 41 insertions(+), 2 deletions(-) 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',