Отключено выполнение обновления если не было изменений в репозиториях или /etc/portage

legacy27 3.6.8.1
parent 3de843415e
commit c131228cbc

@ -51,6 +51,7 @@ from calculate.lib.utils.portage import (ReposConf, EmergeLog,
EmergeLogNamedTask, EmergeLogNamedTask,
VDB_PATH, VDB_PATH,
PackageInformation, PackageInformation,
PortageState,
get_packages_files_directory, get_packages_files_directory,
get_manifest_files_directory, get_manifest_files_directory,
get_remove_list) get_remove_list)
@ -1723,3 +1724,13 @@ class Update(MethodsInterface):
except IOError as e: except IOError as e:
self.printWARNING(str(e)) self.printWARNING(str(e))
return True return True
def save_portage_state_hash(self):
"""
Сохранить состояние
"""
ini = SystemIni(self.clVars)
ps = PortageState()
new_portage_state_hash = ps.get_state()
ini.setVar('system', {'portage_hash': new_portage_state_hash})
return True

@ -265,12 +265,24 @@ class ClUpdateAction(Action):
'method': 'Update.premerge("-uDN","@world")', 'method': 'Update.premerge("-uDN","@world")',
'condition': lambda Get: ( 'condition': lambda Get: (
Get('cl_update_sync_only_set') == 'off' and Get('cl_update_sync_only_set') == 'off' and
Get('cl_update_pretend_set') == 'on') Get('cl_update_pretend_set') == 'on') and \
(Get('cl_update_world') != "update" or
Get('cl_update_outdate_set') == 'on' or
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('update.cl_update_package_cache_set') == 'on')
}], }],
}, },
{'name': 'update', {'name': 'update',
'condition': lambda Get:Get('cl_update_pretend_set') == 'off', 'condition': lambda Get:Get('cl_update_pretend_set') == 'off' and \
}, (Get('cl_update_world') != "update" or
Get('cl_update_outdate_set') == 'on' or
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('update.cl_update_package_cache_set') == 'on')
},
{'name': 'update_other', {'name': 'update_other',
'condition': lambda Get: ( Get('cl_update_pretend_set') == 'off' and 'condition': lambda Get: ( Get('cl_update_pretend_set') == 'off' and
Get('cl_update_sync_only_set') == 'off') Get('cl_update_sync_only_set') == 'off')
@ -413,6 +425,10 @@ class ClUpdateAction(Action):
'depend': Tasks.failed_all("check_schedule") 'depend': Tasks.failed_all("check_schedule")
}, },
# сообщение удачного завершения при обновлении ревизии # сообщение удачного завершения при обновлении ревизии
{'name': 'update:save_portage_hash',
'method': 'Update.save_portage_state_hash()',
},
# сообщение удачного завершения при обновлении ревизии
{'name': 'success_rev', {'name': 'success_rev',
'message': __("System update finished!"), 'message': __("System update finished!"),
'condition': lambda Get: (Get('cl_update_rev_set') == 'on' and 'condition': lambda Get: (Get('cl_update_rev_set') == 'on' and

@ -33,7 +33,7 @@ from calculate.lib.configparser import ConfigParser
from calculate.lib.cl_lang import setLocalTranslate from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.text import simplify_profiles, _u8 from calculate.lib.utils.text import simplify_profiles, _u8
from calculate.lib.utils.git import Git, GitError from calculate.lib.utils.git import Git, GitError
from calculate.lib.utils.portage import ReposConf from calculate.lib.utils.portage import ReposConf, PortageState
from ..profile import (RepositoryStorageSet, DEFAULT_BRANCH, from ..profile import (RepositoryStorageSet, DEFAULT_BRANCH,
LocalStorage, ProfileRepository, CacheStorage) LocalStorage, ProfileRepository, CacheStorage)
@ -378,6 +378,20 @@ class VariableClUpdateLastTimestamp(ReadonlyVariable):
return ini.getVar('system', 'last_update') or "0" return ini.getVar('system', 'last_update') or "0"
class VariableClUpdateSettingsChangesSet(Variable):
"""
Определить были ли изменения в /etc/portage, /var/log/emerge.log
"""
type = Variable.Types.Boolean
def get(self):
ini = SystemIni(self.parent)
old_portage_state_hash = ini.getVar('system', 'portage_hash') or ""
ps = PortageState()
new_portage_state_hash = ps.get_state()
return "on" if new_portage_state_hash != old_portage_state_hash else "off"
class VariableClUpdateBranchName(Variable): class VariableClUpdateBranchName(Variable):
""" """
Список доступных репозиторием Список доступных репозиторием

Loading…
Cancel
Save