изменено: pym/update/update.py

изменено:      pym/update/utils/cl_update.py
	изменено:      pym/update/variables/update.py
	изменено:      pym/update/wsdl_update.py
master
root 1 year ago
parent 7ebe12260f
commit a9e5b78c64

@ -1490,7 +1490,7 @@ class Update(MethodsInterface):
if not changes:
return False
self.create_binhost_data(a)
self.create_binhost_data()
return True
def drop_binhosts(self, dv):
@ -1624,10 +1624,14 @@ class Update(MethodsInterface):
binhost_list = dv.Get('cl_update_binhost_unstable_list')
dv.Write('cl_update_binhost_set', "off")
else:
if dv.Get('cl_update_binhost_choice'):
dv.Write('cl_update_binhost', dv.Get('cl_update_binhost_choice'))
dv.Write('cl_update_binhost_set', "on")
binhost_list = [dv.Get('cl_update_binhost')]
# if dv.Get('cl_update_binhost_choice'):
# dv.Write('cl_update_binhost', dv.Get('cl_update_binhost_choice'))
# dv.Write('cl_update_binhost_set', "on")
binhost = dv.Get('cl_update_binhost_choice')
if not binhost.startswith('https://') and not binhost.startswith('ftp://') and not binhost.startswith(
'http://'):
binhost = f"https://{binhost}"
binhost_list = [binhost]
self.binhosts_data = Binhosts(
# значение малозначимо, поэтому берётся из собирающей системы
@ -1637,6 +1641,7 @@ class Update(MethodsInterface):
last_ts, binhost_list,
self.get_arch_machine(),
gpg=dv.Get('update.cl_update_gpg'))
return True
@variable_module("update")
@ -1742,8 +1747,8 @@ class Update(MethodsInterface):
"""
Проверка текущего сервера обновлений на валидность
"""
if not binhost_url in self.binhosts_data.binhost_list:
raise UpdateError(_("Current binhost is absent in list of update servers"))
# if not binhost_url in self.binhosts_data.binhost_list:
# raise UpdateError(_("Current binhost is absent in list of update servers"))
binhost = self.binhosts_data.get_binhost(binhost_url)
ignore_level = self.clVars.Get("cl_update_ignore_level") == Variable.On
cur_level_valid = self.is_current_level_a_digit() if not ignore_level else None
@ -1800,6 +1805,8 @@ class Update(MethodsInterface):
raise UpdateError(
_("Current binhost {} has wrong signature").format(
binhost_url))
self.clVars.Write('cl_update_binhost', binhost_url)
self.clVars.Write('cl_update_binhost_set', 'on')
return True
def get_migration_mirror_url(self, host, level):

@ -56,7 +56,7 @@ def get_synchronization_tasks(object_name):
{'name': 'check_current_binhost',
'message': __("Checking current binhost"),
'essential': False,
'method': Object('check_current_binhost(update.cl_update_binhost)'),
'method': Object('check_current_binhost(update.cl_update_new_binhost)'),
'condition': lambda GetBool, Get: (
not GetBool('update.cl_update_binhost_recheck_set') and
Get('update.cl_update_sync_rep') and

@ -199,16 +199,17 @@ class VariableClUpdateRepHosting(Variable):
class VariableClUpdateRepHostingChoice(Variable):
type = "choice"
value = ''
opt = ["--hosting"]
opt = ["--repo-update"]
metavalue = (_("REPOSITORY URL"))
def init(self):
self.label = (_("Hosting name"))
self.help = (_("Hosting to download from"))
self.label = (_("Update repository"))
self.help = (_("Hosting to download repository from"))
def choice(self):
a = [x[1] for x in self.Get('cl_update_inner_rep_list')]
b = self.Get('cl_update_inner_rep_list')
return [x[1] for x in self.Get('cl_update_inner_rep_list')]
return [x[1] for x in self.Get('cl_update_inner_rep_list')] or ['Default']
class VariableClUpdateLaymanStorage(Variable):
@ -1695,15 +1696,29 @@ class VariableClUpdateBinhostStableOptSet(Variable):
class VariableClUpdateBinhostChoice(Variable):
type = "choiceedit"
value = ''
opt = ["--binhost"]
opt = ["-m", "--mirror-update"]
metavalue = "MIRROR_URL"
def init(self):
self.label = _("Mirror url")
self.label = _("Packages mirror")
self.help = _("Url to download binary packages from")
def choice(self):
return self.Get("cl_update_binhost_list")
class VariableClUpdateNewBinhost(Variable):
def get(self):
if self.Get('cl_update_binhost_choice'):
binhost = self.Get('cl_update_binhost_choice')
if binhost == 'auto':
return self.Get('cl_update_binhost')
elif not binhost.startswith('https://') and not binhost.startswith('ftp://') and not binhost.startswith(
'http://'):
binhost = f"https://{binhost}"
return binhost
return self.Get('cl_update_binhost')
class VariableClUpdateBinhost(Variable):
"""

@ -69,13 +69,13 @@ class Wsdl(WsdlBase):
'cl_update_binhost_stable_opt_set',
'cl_update_binhost_recheck_set',
'cl_update_with_bdeps_opt_set',
'cl_update_binhost_choice',
'cl_update_rep_hosting_choice',
),
expert=(
'cl_update_inner_other_set',
'cl_update_sync_only_set',
'cl_update_pretend_set',
'cl_update_binhost_choice',
'cl_update_rep_hosting_choice',
'cl_update_sync_rep',
'cl_update_emergelist_set',
'cl_update_check_rep_set',
@ -125,7 +125,7 @@ class Wsdl(WsdlBase):
'native_error': (VariableError, DataVarsError,
InstallError, UpdateError, GitError),
# значения по умолчанию для переменных этого метода
'setvars': {'cl_action!': 'update_profile', 'cl_update_world_default': 'rebuild'},
'setvars': {'cl_action!': 'update_profile', 'cl_update_world_default': "rebuild"},
# описание груп (список лямбда функций)
'groups': [
lambda group: group(_("Repository"),

Loading…
Cancel
Save