|
|
|
@ -29,6 +29,7 @@ from calculate.lib.utils.portage import (EmergeLogNamedTask,
|
|
|
|
|
PackageList, EmergeLog, isPkgInstalled)
|
|
|
|
|
from calculate.install.distr import DistributiveError
|
|
|
|
|
from calculate.update.update_tasks import EmergeMark
|
|
|
|
|
from calculate.update.utils.cl_update import get_synchronization_tasks
|
|
|
|
|
|
|
|
|
|
_ = lambda x: x
|
|
|
|
|
setLocalTranslate('cl_builder3', sys.modules[__name__])
|
|
|
|
@ -112,128 +113,19 @@ class ClBuilderUpdateAction(Action):
|
|
|
|
|
'method': 'Builder.reconfigureProfileVars('
|
|
|
|
|
'cl_builder_linux_datavars,cl_builder_path)'
|
|
|
|
|
},
|
|
|
|
|
{'name': 'apply_branch_vars',
|
|
|
|
|
'method': 'Builder.apply_branch_variables()'
|
|
|
|
|
},
|
|
|
|
|
{'name': 'reps_synchronization',
|
|
|
|
|
'group': __("Repositories synchronization"),
|
|
|
|
|
'tasks': [
|
|
|
|
|
# запасная синхронизация, в ходе которой ветки
|
|
|
|
|
# обновляются до master
|
|
|
|
|
{'name': 'sync_reps_fallback',
|
|
|
|
|
'foreach': 'cl_builder_sync_rep',
|
|
|
|
|
'message':
|
|
|
|
|
__("Fallback syncing the {eachvar:capitalize} "
|
|
|
|
|
"repository"),
|
|
|
|
|
'method': 'Builder.syncRepositories(eachvar,True)',
|
|
|
|
|
'condition': lambda Get: (
|
|
|
|
|
Get('cl_builder_usetag_set') == "on" and
|
|
|
|
|
not Get('update.cl_update_binhost_data')[0])
|
|
|
|
|
},
|
|
|
|
|
# обновление переменных информации из binhost
|
|
|
|
|
{'name': 'invalidate_vars',
|
|
|
|
|
'method':
|
|
|
|
|
'Builder.invalidateVariables('
|
|
|
|
|
'"cl_builder_linux_datavars")',
|
|
|
|
|
'condition': lambda Get: (
|
|
|
|
|
Get('cl_builder_usetag_set') == "on" and
|
|
|
|
|
not Get('update.cl_update_binhost_data')[0])
|
|
|
|
|
},
|
|
|
|
|
{'name': 'binhost_unavailable',
|
|
|
|
|
'error': __("Update server is unavailable"),
|
|
|
|
|
'condition': lambda Get: (
|
|
|
|
|
Get('cl_builder_usetag_set') == "on" and
|
|
|
|
|
not Get('update.cl_update_binhost_data')[0])
|
|
|
|
|
},
|
|
|
|
|
{'name': 'sync_reps',
|
|
|
|
|
'foreach': 'cl_builder_sync_rep',
|
|
|
|
|
'message': __("Checking {eachvar:capitalize} updates"),
|
|
|
|
|
'method': 'Builder.syncRepositories(eachvar)',
|
|
|
|
|
'condition': lambda Get: Get('cl_builder_sync_rep')
|
|
|
|
|
},
|
|
|
|
|
{'name': 'check_binhost',
|
|
|
|
|
'method': 'Builder.check_binhost(True)',
|
|
|
|
|
'condition': lambda Get: Get(
|
|
|
|
|
'cl_builder_usetag_set') == "on"
|
|
|
|
|
},
|
|
|
|
|
{'name': 'use_base_binhost',
|
|
|
|
|
'method': 'Builder.set_base_binhost('
|
|
|
|
|
'builder.cl_builder_binhost_base)',
|
|
|
|
|
'condition': lambda Get, GetBool: (
|
|
|
|
|
GetBool("builder.cl_builder_binhost_base_set") and
|
|
|
|
|
Get("builder.cl_builder_binhost_base"))
|
|
|
|
|
},
|
|
|
|
|
{'name': 'update_layman',
|
|
|
|
|
'message': __("Layman cache update"),
|
|
|
|
|
'method': "Builder.update_layman(cl_builder_path)",
|
|
|
|
|
'condition': lambda Get: isPkgInstalled(
|
|
|
|
|
"app-portage/layman", prefix=Get('cl_chroot_path')),
|
|
|
|
|
'essential': False,
|
|
|
|
|
},
|
|
|
|
|
{'name': 'sync_other_reps',
|
|
|
|
|
'foreach': 'builder.cl_builder_other_rep_name',
|
|
|
|
|
'message': __(
|
|
|
|
|
"Syncing the {eachvar:capitalize} repository"),
|
|
|
|
|
'method': 'Builder.syncLaymanRepository(eachvar)',
|
|
|
|
|
'condition': lambda Get: Get(
|
|
|
|
|
'update.cl_update_other_set') == 'on'
|
|
|
|
|
},
|
|
|
|
|
{'name': 'trim_reps',
|
|
|
|
|
'foreach': 'cl_builder_sync_rep',
|
|
|
|
|
'message': __("Cleaning the history of the "
|
|
|
|
|
"{eachvar:capitalize} repository"),
|
|
|
|
|
'method': 'Builder.trimRepositories(eachvar)',
|
|
|
|
|
'condition': lambda Get: (
|
|
|
|
|
Get('cl_builder_sync_rep') and
|
|
|
|
|
Get('update.cl_update_onedepth_set') == 'on')
|
|
|
|
|
},
|
|
|
|
|
{'name': 'regen_cache',
|
|
|
|
|
'foreach': 'cl_builder_sync_overlay_rep',
|
|
|
|
|
'essential': False,
|
|
|
|
|
'method': 'Builder.regenCache(eachvar)',
|
|
|
|
|
'condition': (lambda Get: (
|
|
|
|
|
Get('builder.cl_builder_outdate_set') == 'on' and
|
|
|
|
|
Get('update.cl_update_egencache_force') != 'skip' or
|
|
|
|
|
Get('update.cl_update_egencache_force') == 'force'))
|
|
|
|
|
},
|
|
|
|
|
{'name': 'eix_update',
|
|
|
|
|
'message': __("Updating the eix cache for "
|
|
|
|
|
"{cl_builder_eix_repositories}"),
|
|
|
|
|
'method': 'Builder.eixUpdate(cl_builder_repository_name)',
|
|
|
|
|
'condition': (lambda Get: (
|
|
|
|
|
Get('builder.cl_builder_outdate_set') == 'on' and
|
|
|
|
|
Get('update.cl_update_eixupdate_force') != 'skip' or
|
|
|
|
|
Get('update.cl_update_eixupdate_force') == 'force'))
|
|
|
|
|
},
|
|
|
|
|
{'name': 'sync_reps:cleanpkg',
|
|
|
|
|
'message': __(
|
|
|
|
|
"Removing obsolete distfiles and binary packages"),
|
|
|
|
|
'method': 'Builder.cleanpkg()',
|
|
|
|
|
'condition': lambda Get: (
|
|
|
|
|
Get('builder.cl_builder_outdate_set') == 'on' and
|
|
|
|
|
Get('update.cl_update_cleanpkg_set') == 'on'),
|
|
|
|
|
'essential': False
|
|
|
|
|
},
|
|
|
|
|
{'name': 'update_packages_cache',
|
|
|
|
|
'message': __("Update packages index"),
|
|
|
|
|
'method': 'Builder.download_packages('
|
|
|
|
|
'builder.cl_builder_portage_binhost,'
|
|
|
|
|
'update.cl_update_package_cache)',
|
|
|
|
|
'essential': False,
|
|
|
|
|
'condition': lambda Get: (
|
|
|
|
|
Get('update.cl_update_package_cache') and (
|
|
|
|
|
Get('builder.cl_builder_outdate_set') == 'on' or
|
|
|
|
|
Get('update.cl_update_package_cache_set') == 'on'))
|
|
|
|
|
},
|
|
|
|
|
# сообщение удачного завершения при обновлении репозиториев
|
|
|
|
|
{'name': 'success_syncrep',
|
|
|
|
|
'message': __("Synchronization finished"),
|
|
|
|
|
'depend': (Tasks.success() & Tasks.has_any(
|
|
|
|
|
"sync_reps", "sync_other_reps", "emerge_metadata",
|
|
|
|
|
"eix_update")),
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
# настроить переменные update для унификации синхронизации репозиториев
|
|
|
|
|
{'name': 'prepare_update_vars',
|
|
|
|
|
'method': 'Builder.prepare_update_vars()',
|
|
|
|
|
},
|
|
|
|
|
{'name': 'not_use_search',
|
|
|
|
|
'message': __("Will be used base binhost: {builder.cl_builder_binhost_base}"),
|
|
|
|
|
'method': 'Builder.set_base_binhost('
|
|
|
|
|
'builder.cl_builder_binhost_base)',
|
|
|
|
|
'condition': lambda Get, GetBool: (
|
|
|
|
|
GetBool("builder.cl_builder_binhost_base_set") and
|
|
|
|
|
Get("builder.cl_builder_binhost_base"))
|
|
|
|
|
},
|
|
|
|
|
] + get_synchronization_tasks("Builder") + [
|
|
|
|
|
{'name': 'reps_synchronization',
|
|
|
|
|
'group': __("System configuration"),
|
|
|
|
|
'tasks': [
|
|
|
|
|