Добавлена возможность использования testing серверов обновлений

parent 9e5257a1ea
commit 946c3a561d

@ -48,6 +48,10 @@ class ClBuilderProfileAction(Action):
'method': 'Builder.check_build_run()'},
{'name': 'check_chroot_run',
'method': 'Builder.check_chroot_run()'},
{'name': 'allow_scan_binhost',
'method': 'Builder.setVariable("cl_builder_binhost_scan_set",'
'"on",True)'
},
{'name': 'migrate_repository',
'method': 'Builder.migrateCacheRepository('
'cl_builder_profile_url,cl_builder_profile_branch,'

@ -75,6 +75,10 @@ class ClBuilderUpdateAction(Action):
{'name': 'clear_log',
'method': 'Builder.clear_log(cl_builder_id_path)',
},
{'name': 'allow_scan_binhost',
'method': 'Builder.setVariable("cl_builder_binhost_scan_set",'
'"on",True)'
},
{'name': 'apply_template',
'message': __("Configuring build"),
'method': 'Builder.applyTemplates(cl_builder_target,False,'

@ -26,6 +26,7 @@ from calculate.lib.utils.grub import GrubCommand
from calculate.lib.utils.portage import getSquashList
from calculate.lib.variables.system import RootType
from .action import Actions
import linux as vars_linux
from calculate.install import distr
from calculate.lib.utils.device import getUdevDeviceInfo, humanreadableSize
from calculate.lib.utils.files import (isMount, process, typeFile,
@ -38,7 +39,7 @@ from ..build_storage import BuildStorage, Build
from ..drive_spool import DriveSpool
from .action import Actions as BuilderActions
from calculate.lib.datavars import (Variable, VariableError, ReadonlyVariable,
TableVariable)
TableVariable, WRITEABLE)
from functools import wraps
_ = lambda x: x
@ -1621,3 +1622,34 @@ class VariableClBuilderEixRepositories(ReadonlyVariable):
x for x in chain(
reversed(self.Get('update.cl_update_rep_name')),
self.Get('builder.cl_builder_other_rep_name')))
class VariableClBuilderBinhostStableSet(
vars_linux.VariableClBuilderLinuxDatavars):
"""
Удлять лишние файлы из репозиториев (например созданные пользователем)
"""
type = "bool"
value = "on"
mode = WRITEABLE
opt = ["--stable"]
def init(self):
self.label = _("Check the repositories integrity")
self.help = _("use only stable updates")
def prepare_vars(self, dvbl):
pass
def get(self):
if self.Get('cl_action') in Actions.WorkAssemble:
dv = self.target_data()
return dv.Get('update.cl_update_binhost_stable_set')
return self.Get('update.cl_update_binhost_stable_set')
class VariableClBuilderBinhostScanSet(Variable):
"""
Сканировать или нет зеркала (переменная переключается во время действия)
"""
value = "off"

@ -96,6 +96,8 @@ class DataVarsBuilderLinux(linux.LinuxDataVars):
update.VariableClUpdateLastTimestamp(section="update"),
update.VariableClUpdateBinhostTimeout(section="update"),
update.VariableClUpdateBinhostList(section="update"),
update.VariableClUpdateBinhostUnstableList(section="update"),
update.VariableClUpdateBinhostStableSet(section="update"),
update.VariableClUpdateBinhostTimestampPath(
section="update"),
update.VariableClUpdateBinhostRevisionPath(
@ -154,6 +156,17 @@ class VariableClBuilderLinuxDatavars(ReadonlyVariable):
image_fn = self.Get('cl_builder_source_filename')
return self.get_data(image, image_fn=image_fn, source=True)
def prepare_vars(self, dvbl):
dvbl['cl_update_binhost_recheck_set'] = \
self.Get('update.cl_update_binhost_recheck_set')
dvbl['cl_update_binhost_stable_set'] = \
self.Get('cl_builder_binhost_stable_set')
if self.Get('cl_action') not in (
Actions.Update, Actions.ChangeProfile) or \
not self.GetBool('cl_builder_binhost_scan_set'):
dvbl.cache['cl_update_binhost_data'] = [[]]
dvbl.prepare_all()
def get_data(self, image, image_fn=None, source=False):
if image:
if isinstance(image, distr.ArchiveDistributive):
@ -162,12 +175,7 @@ class VariableClBuilderLinuxDatavars(ReadonlyVariable):
with ignore(DistributiveError):
distr_dn = image.getDirectory()
dvbl = DataVarsBuilderLinux(systemRoot=distr_dn)
dvbl['cl_update_binhost_recheck_set'] = \
self.Get('update.cl_update_binhost_recheck_set')
if self.Get('cl_action') not in (
Actions.Update, Actions.ChangeProfile):
dvbl.cache['cl_update_binhost_data'] = [[]]
dvbl.prepare_all()
self.prepare_vars(dvbl)
return dvbl
else:
return ""

@ -176,7 +176,8 @@ class Wsdl(WsdlBase):
'groups': [
lambda group: group(
_("Update the Build"),
normal=('cl_builder_prepared_id',),
normal=('cl_builder_prepared_id',
'cl_builder_binhost_stable_set'),
expert=(
'update.cl_update_sync_only_set',
'update.cl_update_other_set',

Loading…
Cancel
Save