From d9f6f0f859dac0eb9973a60a3685ec57a9b44a19 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 18 Nov 2022 12:23:15 +0300 Subject: [PATCH] =?UTF-8?q?=09=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B8=D0=B8=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D0=B8=D0=B8=203.7.3.0=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20cl-builder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/update.py | 10 ++++++++-- pym/update/utils/cl_update.py | 1 + pym/update/utils/cl_update_profile.py | 1 + pym/update/variables/update.py | 12 ++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pym/update/update.py b/pym/update/update.py index 668c735..0e58e24 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -1618,8 +1618,8 @@ class Update(MethodsInterface): def create_binhost_data(self): dv = self.clVars last_ts = dv.Get('cl_update_last_timestamp') - if (not dv.Get('cl_update_binhost_choice') and not dv.GetBool('update.cl_update_binhost_set')) \ - or dv.Get('cl_update_binhost_choice') == 'auto': + 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': if dv.Get('cl_update_binhost_stable_opt_set'): binhost_list = dv.Get('cl_update_binhost_list') else: @@ -1648,6 +1648,12 @@ class Update(MethodsInterface): @variable_module("update") def _search_best_binhost(self, binhosts_data, stabilization, ignore_level=False): + try: + if self.clVars.Get("cl_update_binhost_choice"): + self.clVars.Set('update.cl_update_binhost', self.clVars.Get("cl_update_binhost_choice")) + return self.clVars.Get("cl_update_binhost_choice") + except: + pass if not self.clVars.Get('cl_ebuild_phase'): logger = self._get_binhost_logger() if logger: diff --git a/pym/update/utils/cl_update.py b/pym/update/utils/cl_update.py index 61b0a94..5e8b14c 100644 --- a/pym/update/utils/cl_update.py +++ b/pym/update/utils/cl_update.py @@ -128,6 +128,7 @@ def get_synchronization_tasks(object_name): }, {'name': 'sync_reps:update_local_info_binhost', 'method': Object('update_local_info_binhost()'), + 'condition': lambda Get: not Get("update.cl_update_binhost_choice") }, {'name': 'sync_reps:update_binhost_list', 'essential': False, diff --git a/pym/update/utils/cl_update_profile.py b/pym/update/utils/cl_update_profile.py index 6799c4e..ab7f5b3 100644 --- a/pym/update/utils/cl_update_profile.py +++ b/pym/update/utils/cl_update_profile.py @@ -75,6 +75,7 @@ class ClUpdateProfileAction(Action): 'foreach': 'cl_update_profile_sync_rep', 'message': __("Syncing the {eachvar:capitalize} repository"), 'method': 'Update.syncRepositories(eachvar)', + 'condition': lambda Get: Get('cl_update_profile_check_sync') }, {'name': 'sync_reps:regen_cache', 'foreach': 'cl_update_sync_overlay_rep', diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index ea69bb5..152101f 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -932,6 +932,16 @@ class VariableClUpdateProfileDependUrl(FieldValue, ReadonlyVariable): self.label = _("URL") +class VariableClUpdateProfileCheckSync(Variable): + urls = 'cl_update_rep_url' + names = 'cl_update_rep_name' + + def get(self): + if not self.Get(self.urls) or not self.Get(self.names): + return False + return True + + class VariableClUpdateProfileRepName(ReadonlyVariable): type = "list" @@ -1414,6 +1424,8 @@ class DataVarsUpdateProfile(SimpleDataVars): VariableClUpdateBinhostStableSet(section="update"), VariableClUpdateBinhostStableOptSet(section="update"), VariableClUpdateBinhostRevisionPath(section="update"), + VariableClUpdateRepHosting(section="update"), + VariableClUpdateBinhostSet(section="update"), ) self['cl_profile_system'] = profile self['cl_chroot_path'] = chroot_path