|
|
|
@ -18,6 +18,7 @@ import sys
|
|
|
|
|
from calculate.core.server.func import Action, Tasks
|
|
|
|
|
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
|
|
|
|
|
from calculate.lib.cl_template import TemplatesError
|
|
|
|
|
from calculate.lib.utils.binhosts import BinhostError
|
|
|
|
|
from calculate.lib.utils.files import FilesError
|
|
|
|
|
from calculate.update.update import UpdateError
|
|
|
|
|
from calculate.update.emerge_parser import EmergeError
|
|
|
|
@ -54,7 +55,7 @@ class ClUpdateAction(Action):
|
|
|
|
|
"""
|
|
|
|
|
# ошибки, которые отображаются без подробностей
|
|
|
|
|
native_error = (FilesError, UpdateError,
|
|
|
|
|
TemplatesError,
|
|
|
|
|
TemplatesError, BinhostError,
|
|
|
|
|
GitError, EmergeError)
|
|
|
|
|
|
|
|
|
|
successMessage = None
|
|
|
|
@ -183,7 +184,7 @@ class ClUpdateAction(Action):
|
|
|
|
|
'foreach': 'cl_update_sync_rep',
|
|
|
|
|
'message':
|
|
|
|
|
__("Fallback syncing the {eachvar:capitalize} repository"),
|
|
|
|
|
'method': 'Update.syncRepositories(eachvar)',
|
|
|
|
|
'method': 'Update.syncRepositories(eachvar,True)',
|
|
|
|
|
'condition': lambda Get: ("getbinpkg" in Get('cl_features') and
|
|
|
|
|
not Get('cl_update_binhost_data')[0])
|
|
|
|
|
},
|
|
|
|
@ -195,7 +196,7 @@ class ClUpdateAction(Action):
|
|
|
|
|
},
|
|
|
|
|
{'name': 'sync_reps',
|
|
|
|
|
'foreach': 'cl_update_sync_rep',
|
|
|
|
|
'message': __("Syncing the {eachvar:capitalize} repository"),
|
|
|
|
|
'message': __("Checking {eachvar:capitalize} updates"),
|
|
|
|
|
'method': 'Update.syncRepositories(eachvar)',
|
|
|
|
|
'condition': lambda Get: Get('cl_update_sync_rep')
|
|
|
|
|
},
|
|
|
|
@ -257,10 +258,19 @@ class ClUpdateAction(Action):
|
|
|
|
|
{'name': 'sync_reps:cleanpkg',
|
|
|
|
|
'message': __("Removing obsolete distfiles and binary packages"),
|
|
|
|
|
'method': 'Update.cleanpkg()',
|
|
|
|
|
'condition': (lambda Get: Get('cl_update_cleanpkg_set') == 'on' and
|
|
|
|
|
Get('cl_update_outdate_set') == 'on'),
|
|
|
|
|
'condition': (
|
|
|
|
|
lambda Get: Get('cl_update_cleanpkg_set') == 'on' and
|
|
|
|
|
Get('cl_update_outdate_set') == 'on'),
|
|
|
|
|
'essential': False
|
|
|
|
|
},
|
|
|
|
|
{'name': 'update_packages_cache',
|
|
|
|
|
'message': __("Update packages index"),
|
|
|
|
|
'method': 'Update.download_packages(cl_update_portage_binhost,'
|
|
|
|
|
'cl_update_package_cache)',
|
|
|
|
|
'condition': lambda Get: (
|
|
|
|
|
Get('cl_update_outdate_set') == 'on' or
|
|
|
|
|
Get('cl_update_package_cache_set') == 'on')
|
|
|
|
|
},
|
|
|
|
|
# сообщение удачного завершения при обновлении репозиториев
|
|
|
|
|
{'name': 'success_syncrep',
|
|
|
|
|
'message': __("Synchronization finished"),
|
|
|
|
@ -268,7 +278,7 @@ class ClUpdateAction(Action):
|
|
|
|
|
"sync_other_reps",
|
|
|
|
|
"emerge_metadata",
|
|
|
|
|
"eix_update")),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{'name': 'reps_synchronization',
|
|
|
|
@ -278,13 +288,18 @@ class ClUpdateAction(Action):
|
|
|
|
|
'message': __("Fixing the settings"),
|
|
|
|
|
'method': 'Update.applyTemplates(install.cl_source,'
|
|
|
|
|
'cl_template_clt_set,True,None,False)',
|
|
|
|
|
'condition': lambda Get: Get('cl_templates_locate')
|
|
|
|
|
'condition': lambda Get: (Get('cl_templates_locate') and
|
|
|
|
|
(Get('cl_update_outdate_set') == 'on' or
|
|
|
|
|
Get('cl_update_force_fix_set') == 'on'))
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
{'name': 'dispatch_conf',
|
|
|
|
|
'message': __("Updating configuration files"),
|
|
|
|
|
'method':'Update.dispatchConf()',
|
|
|
|
|
'method': 'Update.dispatchConf()',
|
|
|
|
|
'condition': lambda Get: (Get('cl_dispatch_conf') != 'skip' and
|
|
|
|
|
Get('cl_update_pretend_set') == 'off')
|
|
|
|
|
Get('cl_update_pretend_set') == 'off' and
|
|
|
|
|
(Get('cl_update_outdate_set') == 'on' or
|
|
|
|
|
Get('cl_update_force_fix_set') == 'on'))
|
|
|
|
|
},
|
|
|
|
|
{'name': 'binhost_changed',
|
|
|
|
|
'method': 'Update.message_binhost_changed()'
|
|
|
|
|