|
|
|
@ -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),
|
|
|
|
|