Explorar el Código

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

tags/3.6.8.1
padre
commit
c131228cbc
Se han modificado 3 ficheros con 45 adiciones y 4 borrados
  1. +11
    -0
      pym/update/update.py
  2. +19
    -3
      pym/update/utils/cl_update.py
  3. +15
    -1
      pym/update/variables/update.py

+ 11
- 0
pym/update/update.py Ver fichero

@@ -51,6 +51,7 @@ from calculate.lib.utils.portage import (ReposConf, EmergeLog,
EmergeLogNamedTask,
VDB_PATH,
PackageInformation,
PortageState,
get_packages_files_directory,
get_manifest_files_directory,
get_remove_list)
@@ -1723,3 +1724,13 @@ class Update(MethodsInterface):
except IOError as e:
self.printWARNING(str(e))
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

+ 19
- 3
pym/update/utils/cl_update.py Ver fichero

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


+ 15
- 1
pym/update/variables/update.py Ver fichero

@@ -33,7 +33,7 @@ from calculate.lib.configparser import ConfigParser
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.text import simplify_profiles, _u8
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,
LocalStorage, ProfileRepository, CacheStorage)

@@ -378,6 +378,20 @@ class VariableClUpdateLastTimestamp(ReadonlyVariable):
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):
"""
Список доступных репозиторием


Cargando…
Cancelar
Guardar