From 3986bf1b9b449744ef12da90205decda249893d1 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: Fri, 24 Aug 2018 10:41:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B2=D1=8B=D0=B1=D1=80=D0=B0=D0=BD=D0=BD=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=B7=D0=B5=D1=80=D0=BA=D0=B0=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/update.py | 6 ++++-- pym/update/utils/cl_update.py | 32 +++++++++++++++++--------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/pym/update/update.py b/pym/update/update.py index f15cce3..bedeb90 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -1277,10 +1277,12 @@ class Update(MethodsInterface): def message_binhost_changed(self): if self.refresh_binhost: self.printWARNING(_("Update server was changed to %s") % - self.clVars.Get('cl_update_binhost')) + self.clVars.Get('update.cl_update_binhost')) + self.clVars.Set("update.cl_update_package_cache_set", + Variable.On, force=True) else: self.printSUCCESS(_("Update server %s") % - self.clVars.Get('cl_update_binhost')) + self.clVars.Get('update.cl_update_binhost')) return True def delete_binhost(self): diff --git a/pym/update/utils/cl_update.py b/pym/update/utils/cl_update.py index a3c5001..e8f3861 100644 --- a/pym/update/utils/cl_update.py +++ b/pym/update/utils/cl_update.py @@ -144,15 +144,16 @@ def get_synchronization_tasks(object_name): {'name': 'update_layman', 'message': __("Layman cache update"), 'method': Object('update_layman()'), - 'condition': lambda Get: isPkgInstalled( - "app-portage/layman", prefix=Get('cl_chroot_path')), + 'condition': lambda Get: (isPkgInstalled( + "app-portage/layman", prefix=Get('cl_chroot_path')) and + Get('cl_chroot_path') != "/"), 'essential': False, }, {'name': 'sync_other_reps', 'foreach': 'update.cl_update_other_rep_name', 'message': __("Syncing the {eachvar:capitalize} repository"), 'method': Object('syncLaymanRepository(eachvar)'), - 'condition': lambda Get: Get('update.cl_update_other_set') == 'on' + 'condition': lambda GetBool: GetBool('update.cl_update_other_set') }, {'name': 'trim_reps', 'foreach': 'update.cl_update_sync_rep', @@ -375,28 +376,29 @@ class ClUpdateAction(Action): {'name': 'system_configuration', 'group': __("System configuration"), 'tasks': [ + {'name': 'binhost_changed', + 'method': 'Update.message_binhost_changed()' + }, {'name': 'revision', 'message': __("Fixing the settings"), 'method': 'Update.applyTemplates(install.cl_source,' 'cl_template_clt_set,True,None,False)', - 'condition': lambda Get: (Get('cl_templates_locate') and + 'condition': lambda Get, GetBool: (Get('cl_templates_locate') and (Get('cl_update_world') != "update" or - Get('cl_update_outdate_set') == 'on' or - Get('cl_update_binhost_recheck_set') == 'on' or - Get('cl_update_force_fix_set') == 'on')) - + GetBool('cl_update_outdate_set') or + GetBool('cl_update_binhost_recheck_set') or + GetBool('cl_update_force_fix_set') or + GetBool('update.cl_update_package_cache_set'))) }, {'name': 'dispatch_conf', 'message': __("Updating configuration files"), 'method': 'Update.dispatchConf()', - 'condition': lambda Get: (Get('cl_dispatch_conf') != 'skip' and + 'condition': lambda Get, GetBool: (Get('cl_dispatch_conf') != 'skip' and Get('cl_update_pretend_set') == 'off' and - (Get('cl_update_binhost_recheck_set') == 'on' or - Get('cl_update_outdate_set') == 'on' or - Get('cl_update_force_fix_set') == 'on')) - }, - {'name': 'binhost_changed', - 'method': 'Update.message_binhost_changed()' + (GetBool('cl_update_outdate_set') or + GetBool('cl_update_binhost_recheck_set') or + GetBool('cl_update_force_fix_set') or + GetBool('update.cl_update_package_cache_set'))) }, ] }