diff --git a/pym/update/update.py b/pym/update/update.py index 48f1daa..f9f930d 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -1735,6 +1735,14 @@ class Update(MethodsInterface): new_portage_state_hash = ps.get_state() ini.setVar('system', {'portage_hash': new_portage_state_hash}) return True + + def drop_portage_state_hash(self): + """ + Сбросить состояние + """ + ini = SystemIni(self.clVars) + ini.delVar('system', 'portage_hash') + return True def update_fastlogin_domain_path(self): try: diff --git a/pym/update/utils/cl_update.py b/pym/update/utils/cl_update.py index a8a13e1..f139015 100644 --- a/pym/update/utils/cl_update.py +++ b/pym/update/utils/cl_update.py @@ -260,6 +260,10 @@ class ClUpdateAction(Action): {'name': 'update_fastlogin_domain', 'method': "Update.update_fastlogin_domain_path()" }, + {'name': 'drop_portage_hash_on_sync', + 'method': 'Update.drop_portage_state_hash()', + 'condition': lambda Get: Get('cl_update_outdate_set') == 'on' + }, {'name': 'premerge_group', 'group': __("Checking for updates"), 'tasks': [ @@ -284,6 +288,7 @@ class ClUpdateAction(Action): Get('cl_update_settings_changes_set') == 'on' or Get('cl_update_binhost_recheck_set') == 'on' or Get('cl_update_force_fix_set') == 'on' or + Get('cl_update_available_set') == 'on' or Get('update.cl_update_package_cache_set') == 'on') }, {'name': 'update_other', @@ -432,6 +437,11 @@ class ClUpdateAction(Action): # сообщение удачного завершения при обновлении ревизии {'name': 'update:save_portage_hash', 'method': 'Update.save_portage_state_hash()', + 'condition': lambda Get: Get('cl_update_sync_only_set') == 'off' + }, + {'name': 'drop_portage_hash', + 'method': 'Update.drop_portage_state_hash()', + 'depend': Tasks.failed() }, # сообщение удачного завершения при обновлении ревизии {'name': 'success_rev', diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 497c7e5..2f7ace8 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -1535,6 +1535,15 @@ class VariableClUpdateOutdatedKernelSet(ReadonlyVariable): ui = UpdateInfo(self.parent) return "on" if ui.outdated_kernel else "off" +class VariableClUpdateAvailableSet(ReadonlyVariable): + """ + Есть обновления + """ + type = "bool" + + def get(self): + ui = UpdateInfo(self.parent) + return "on" if ui.need_update() else "off" class VariableClUpdateBinhostList(Variable): """