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

master 3.7.2.36
root 1 year ago
parent 78e9deb98a
commit c59f7b06fb

@ -586,6 +586,8 @@ class Update(MethodsInterface):
limit=1)
repdirname = path.basename(rpath)
self.stash_cache(rpath, repdirname)
rpath_old = f"{rpath}_old"
makeDirectory(rpath_old)
try:
if Git.is_git(rpath):
self.addProgress()
@ -601,19 +603,17 @@ class Update(MethodsInterface):
clearDirectory(rpath)
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_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))
os.rmdir(rpath_old)
raise UpdateError(
_("Failed to update the {rname} repository").format(
rname=repname),
addon=p.read())
finally:
removeDir(rpath_old)
self.unstash_cache(rpath, repdirname)
return True

Loading…
Cancel
Save