From 0bca2fc5cd56cc78b96e183e38b0539939387361 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 24 Nov 2022 12:54:43 +0300 Subject: [PATCH] =?UTF-8?q?=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE:=20=20=20=20=20=20pym/update/update.py=20=09=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=BE:=20=20=20=20=20=20pym/upda?= =?UTF-8?q?te/utils/cl=5Fupdate.py=20=09=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE:=20=20=20=20=20=20pym/update/variables/updat?= =?UTF-8?q?e.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/update.py | 7 +++++-- pym/update/utils/cl_update.py | 1 - pym/update/variables/update.py | 8 +++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pym/update/update.py b/pym/update/update.py index 238543e..0bad4b0 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -1573,6 +1573,8 @@ class Update(MethodsInterface): self.clVars.Set('update.cl_update_binhost_recheck_set', Variable.On) self.clVars.Set('cl_update_package_cache_set', Variable.Off, force=True) raise + self.clVars.Write('cl_update_binhost', url_binhost.split('/grp/')[0]) + self.clVars.Set('update.cl_update_binhost', url_binhost.split('/grp/')[0]) return True class Reason(): @@ -1622,7 +1624,8 @@ class Update(MethodsInterface): dv.Write('cl_update_binhost_set', "off") dv.Set('cl_update_binhost_set', 'off') if (not dv.Get('update.cl_update_binhost_choice') and not dv.GetBool('update.cl_update_binhost_set')) \ - or dv.Get('update.cl_update_binhost_choice') == 'auto': + or dv.Get('update.cl_update_binhost_choice') == 'auto' \ + or (dv.Get('update.cl_update_binhost') and not dv.GetBool('update.cl_update_binhost_set')): if dv.Get('cl_update_binhost_stable_opt_set'): binhost_list = dv.Get('cl_update_binhost_list') else: @@ -1846,7 +1849,7 @@ class Update(MethodsInterface): self.clVars.Set('update.cl_update_binhost_data', retval or Variable.EmptyTable, force=True) if not ignore_level: - best_binhost_level = int(self.clVars.Get("update.cl_update_binhost_level")[0]) or None + best_binhost_level = int(self.clVars.Get("update.cl_update_binhost_level")[0]) #int(sorted(self.clVars.Get("update.cl_update_binhost_level"), key=int)[-1]) # int(self.clVars.Get("update.cl_update_binhost_level")[0]) diff --git a/pym/update/utils/cl_update.py b/pym/update/utils/cl_update.py index ade3a38..62652f0 100644 --- a/pym/update/utils/cl_update.py +++ b/pym/update/utils/cl_update.py @@ -141,7 +141,6 @@ def get_synchronization_tasks(object_name): 'method': Object('download_packages(update.cl_update_portage_binhost,' 'update.cl_update_package_cache, update.cl_update_package_cache_sign,' 'update.cl_update_gpg)'), - 'essential': False, 'condition': lambda Get, GetBool: ( Get('update.cl_update_package_cache') and ( Get('update.cl_update_outdate_set') == 'on' or diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 277e4f3..15c15e4 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -207,8 +207,6 @@ class VariableClUpdateRepHostingChoice(Variable): self.help = (_("Hosting to download repository from")) def choice(self): - a = [x[1] for x in self.Get('cl_update_inner_rep_list')] - b = self.Get('cl_update_inner_rep_list') return [x[1] for x in self.Get('cl_update_inner_rep_list')] or ['Default'] @@ -1841,8 +1839,12 @@ class VariableClUpdatePortageBinhost(ReadonlyVariable): """ Прописываемый в /etc/portage/make.conf/binhost репозиторий """ - value_format = "{update.cl_update_binhost}/grp/{os_arch_machine}" + #value_format = "{update.cl_update_binhost}/grp/{os_arch_machine}" + def get(self): + if self.Get('update.cl_update_binhost_choice'): + return f"{self.Get('update.cl_update_binhost_choice')}/grp/{self.Get('os_arch_machine')}" + return f"{self.Get('update.cl_update_binhost')}/grp/{self.Get('os_arch_machine')}" class VariableClUpdatePackageCache(ReadonlyVariable): """