|
|
|
@ -1385,8 +1385,15 @@ class Update(MethodsInterface):
|
|
|
|
|
if hosts[0] != self.clVars.Get('update.cl_update_binhost'):
|
|
|
|
|
self.refresh_binhost = True
|
|
|
|
|
self.clVars.Set('cl_update_package_cache_set', 'on')
|
|
|
|
|
if not self.clVars.GetBool('update.cl_update_binhost_set'):
|
|
|
|
|
if self.clVars.GetBool('update.cl_update_binhost_recheck_set'):
|
|
|
|
|
self.clVars.Write('cl_update_binhost', hosts[0], location="system")
|
|
|
|
|
self.clVars.Write('cl_update_binhost_set', Variable.Off, location="system")
|
|
|
|
|
elif self.clVars.Get('cl_update_binhost_choice') and self.clVars.Get('cl_update_binhost_choice') != 'auto':
|
|
|
|
|
self.clVars.Write('cl_update_binhost', self.clVars.Get('cl_update_binhost_choice'), location="system")
|
|
|
|
|
self.clVars.Write('cl_update_binhost_set', Variable.On, location="system")
|
|
|
|
|
elif not self.clVars.GetBool('update.cl_update_binhost_set'):
|
|
|
|
|
self.clVars.Write('cl_update_binhost', hosts[0], location="system")
|
|
|
|
|
self.clVars.Write('cl_update_binhost_set', Variable.Off, location="system")
|
|
|
|
|
new_ts = self.clVars.Get("update.cl_update_binhost_timestamp")
|
|
|
|
|
if new_ts:
|
|
|
|
|
new_ts = new_ts[0]
|
|
|
|
@ -1573,10 +1580,11 @@ class Update(MethodsInterface):
|
|
|
|
|
self.clVars.Set('update.cl_update_binhost_recheck_set', Variable.On)
|
|
|
|
|
self.clVars.Set('cl_update_package_cache_set', Variable.Off, force=True)
|
|
|
|
|
raise
|
|
|
|
|
self.clVars.Write('cl_update_binhost', url_binhost.split('/grp/')[0])
|
|
|
|
|
self.clVars.Set('update.cl_update_binhost', url_binhost.split('/grp/')[0])
|
|
|
|
|
if self.clVars.Get('update.cl_update_binhost_choice'):
|
|
|
|
|
self.clVars.Write('cl_update_binhost_set', Variable.On)
|
|
|
|
|
# self.clVars.Write('cl_update_binhost', url_binhost.split('/grp/')[0])
|
|
|
|
|
# self.clVars.Set('update.cl_update_binhost', url_binhost.split('/grp/')[0])
|
|
|
|
|
# if self.clVars.Get('update.cl_update_binhost_choice') \
|
|
|
|
|
# and self.clVars.Get('update.cl_update_binhost_choice') != 'auto':
|
|
|
|
|
# self.clVars.Write('cl_update_binhost_set', Variable.On)
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
class Reason():
|
|
|
|
@ -1622,16 +1630,24 @@ class Update(MethodsInterface):
|
|
|
|
|
def create_binhost_data(self):
|
|
|
|
|
dv = self.clVars
|
|
|
|
|
last_ts = dv.Get('cl_update_last_timestamp')
|
|
|
|
|
if not dv.Get('update.cl_update_binhost') and not dv.Get('update.cl_update_binhost_choice'):
|
|
|
|
|
if dv.Get('update.cl_update_binhost_choice') == 'auto'\
|
|
|
|
|
or not dv.Get('update.cl_update_binhost') and not dv.Get('update.cl_update_binhost_choice'):
|
|
|
|
|
dv.Write('cl_update_binhost_set', "off")
|
|
|
|
|
dv.Set('cl_update_binhost_set', 'off')
|
|
|
|
|
if dv.Get('update.cl_update_binhost_choice'):
|
|
|
|
|
|
|
|
|
|
if dv.GetBool('update.cl_update_binhost_recheck_set'):
|
|
|
|
|
if dv.Get('cl_update_binhost_stable_opt_set'):
|
|
|
|
|
binhost_list = dv.Get('cl_update_binhost_list')
|
|
|
|
|
else:
|
|
|
|
|
binhost_list = dv.Get('cl_update_binhost_unstable_list')
|
|
|
|
|
elif dv.Get('update.cl_update_binhost_choice') and dv.Get('update.cl_update_binhost_choice') != 'auto':
|
|
|
|
|
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]
|
|
|
|
|
elif dv.Get('update.cl_update_binhost') and dv.GetBool('update.cl_update_binhost_set'):
|
|
|
|
|
elif dv.Get('update.cl_update_binhost') and dv.GetBool('update.cl_update_binhost_set') \
|
|
|
|
|
and dv.Get('update.cl_update_binhost_choice') != 'auto':
|
|
|
|
|
binhost = dv.Get('cl_update_binhost')
|
|
|
|
|
binhost_list = [binhost]
|
|
|
|
|
else:
|
|
|
|
@ -1800,6 +1816,12 @@ class Update(MethodsInterface):
|
|
|
|
|
Binhosts.check_packages_signature(
|
|
|
|
|
None, pi.get_value(), self.binhosts_data.gpg,
|
|
|
|
|
sign=packages_sign)
|
|
|
|
|
if self.clVars.Get('cl_update_binhost_choice') and self.clVars.Get(
|
|
|
|
|
'cl_update_binhost_choice') != 'auto':
|
|
|
|
|
self.clVars.Write('cl_update_binhost_set', 'on')
|
|
|
|
|
self.clVars.Write('cl_update_binhost', self.clVars.Get('cl_update_binhost_choice'))
|
|
|
|
|
# else:
|
|
|
|
|
# self.clVars.Write('cl_update_binhost', self.)
|
|
|
|
|
return True
|
|
|
|
|
except BinhostSignError:
|
|
|
|
|
for fn in (packages_fn, packages_sign_fn):
|
|
|
|
@ -1813,7 +1835,9 @@ class Update(MethodsInterface):
|
|
|
|
|
_("Current binhost {} has wrong signature").format(
|
|
|
|
|
binhost_url))
|
|
|
|
|
self.clVars.Write('cl_update_binhost', binhost_url)
|
|
|
|
|
self.clVars.Write('cl_update_binhost_set', 'on')
|
|
|
|
|
if self.clVars.Get('cl_update_binhost_choice') and self.clVars.Get('cl_update_binhost_choice') != 'auto':
|
|
|
|
|
self.clVars.Write('cl_update_binhost_set', 'on')
|
|
|
|
|
self.clVars.Write('cl_update_binhost', self.clVars.Get('cl_update_binhost_choice'))
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def get_migration_mirror_url(self, host, level):
|
|
|
|
|