|
|
|
@ -572,6 +572,8 @@ class Update(MethodsInterface):
|
|
|
|
|
for perc in p.progress():
|
|
|
|
|
self.setProgress(perc)
|
|
|
|
|
else:
|
|
|
|
|
p = process(emerge, "--sync", repname, stderr=STDOUT)
|
|
|
|
|
if p.failed():
|
|
|
|
|
rpath_old = f"{rpath}_old"
|
|
|
|
|
makeDirectory(rpath_old)
|
|
|
|
|
for root, dirs, files in os.walk(rpath):
|
|
|
|
@ -579,15 +581,13 @@ class Update(MethodsInterface):
|
|
|
|
|
os.replace(os.path.join(rpath, d), os.path.join(rpath_old, f))
|
|
|
|
|
for d in dirs:
|
|
|
|
|
shutil.move(os.path.join(rpath, d), os.path.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.path.join(rpath_old, d), os.path.join(rpath, f))
|
|
|
|
|
for d in dirs:
|
|
|
|
|
shutil.move(os.path.join(rpath_old, d), os.path.join(rpath, d))
|
|
|
|
|
removeDir(rpath_old)
|
|
|
|
|
os.rmdir(rpath_old)
|
|
|
|
|
raise UpdateError(
|
|
|
|
|
_("Failed to update the {rname} repository").format(
|
|
|
|
|
rname=repname),
|
|
|
|
|