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

изменено:      pym/update/variables/update.py
	изменено:      pym/update/wsdl_update.py
master 3.7.2.31
root 1 year ago
parent 413c9155af
commit f019452b97

@ -66,7 +66,7 @@ from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir,
PercentProgress, process, getRunCommands,
readFile, listDirectory, pathJoin,
find, FindFileType,quite_unlink,
writeFile, makeDirectory)
writeFile, makeDirectory, clearDirectory)
from . import emerge_parser
import logging
from .emerge_parser import (EmergeParser, EmergeCommand, EmergeError,
@ -388,9 +388,11 @@ class Update(MethodsInterface):
git = self.getGit()
working_host = ''
# проверка необходимости синхронизации других оверлеев
if self.clVars.Get("cl_update_inner_other_set"):
a = self.clVars.Get("cl_update_inner_other_set")
if self.clVars.Get("cl_update_inner_other_set") != '':
self.clVars.Write("cl_update_other_set", self.clVars.Get("cl_update_inner_other_set"), header="update")
if 'cl_update_rep_list' in dv.allVars and dv.Get('cl_update_rep_list'):
#if dv.Get("cl_update_rep_hosting_choice"):
# Берем первый доступный хостинг из списка
for host_urls, host in dv.Get('cl_update_inner_rep_list'):
url, rpath, revision = (
@ -570,8 +572,22 @@ class Update(MethodsInterface):
for perc in p.progress():
self.setProgress(perc)
else:
rpath_old = f"{rpath}_old"
makeDirectory(rpath_old)
for root, dirs, files in os.walk(rpath):
for f in files:
os.replace(os.join(rpath, d), os.path.join(rpath_old, f))
for d in dirs:
shutil.move(os.join(rpath, d), os.join(rpath_old, d))
p = process(emerge, "--sync", repname, stderr=STDOUT)
if p.failed():
clearDirectory(rpath)
for root, dirs, files in os.walk(rpath_old):
for f in files:
os.replace(os.join(rpath_old, d), os.path.join(rpath, f))
for d in dirs:
shutil.move(os.join(rpath_old, d), os.join(rpath, d))
removeDir(rpath_old)
raise UpdateError(
_("Failed to update the {rname} repository").format(
rname=repname),

@ -194,6 +194,18 @@ class VariableClUpdateRepHosting(Variable):
value = ''
class VariableClUpdateRepHostingChoice(Variable):
type = "choice"
value = ''
def init(self):
self.label = (_("Hosting name"))
self.help = (_("Hosting to download from"))
def choice(self):
return [x[1] for x in self.Get('cl_update_inner_rep_list')] or ["Calculate"]
class VariableClUpdateLaymanStorage(Variable):
"""
Путь к репозиториям
@ -621,28 +633,31 @@ class VariableClUpdateOtherSet(Variable):
Обновить остальные оверлеи
"""
type = "bool"
value = "on"
def init(self):
self.help = _("update other overlays")
self.label = _("Update other overlays")
value = ""
def get(self):
if self.Get('cl_update_inner_other_set'):
return self.Get('cl_update_inner_other_set')
return self.value
class VariableClUpdateInnerOtherSet(Variable):
type = "string"
value = ''
type = "bool"
value = 'on'
metavalue = 'ON/OFF'
opt = ["-o", "--update-other"]
def get(self):
if self.value in ["on", "off"]:
return True
return False
def init(self):
self.help = _("update other overlays")
self.label = _("Update other overlays")
# def get(self):
# if self.value in ["on", "off"]:
# return True
# return False
class VariableClUpdateOtherRepData(ReadonlyTableVariable):
"""
@ -1685,6 +1700,7 @@ class VariableClUpdateBinhostChoice(Variable):
return self.Get("cl_update_binhost_list")
class VariableClUpdateBinhost(Variable):
"""
Хост с бинарными обновлениями

@ -69,14 +69,15 @@ class Wsdl(WsdlBase):
'cl_update_binhost_stable_opt_set',
'cl_update_binhost_recheck_set',
'cl_update_with_bdeps_opt_set',
'cl_update_other_set'
'cl_update_inner_other_set'
),
expert=(
'cl_update_binhost_choice',
'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',

Loading…
Cancel
Save