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

изменено:      pym/update/variables/update.py
master 3.7.2.33
root 2 years ago
parent 2abe2f904b
commit 9f69807513

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

@ -636,7 +636,6 @@ class VariableClUpdateOtherSet(Variable):
value = "" value = ""
def get(self): def get(self):
if self.Get('cl_update_inner_other_set'): if self.Get('cl_update_inner_other_set'):
return self.Get('cl_update_inner_other_set') return self.Get('cl_update_inner_other_set')
return self.value return self.value

Loading…
Cancel
Save