vartree=vartree, ldpath_mtimes=ldpath_mtimes)
if retval != os.EX_OK:
emergelog(xterm_titles, " !!! unmerge FAILURE: "+y)
+ ebuild = vartree.dbapi.findname(y)
+ show_unmerge_failure_message(y, ebuild, retval)
+ sys.exit(retval)
else:
clean_world(vartree.dbapi, y)
emergelog(xterm_titles, " >>> unmerge success: "+y)
return 1
+def show_unmerge_failure_message(pkg, ebuild, retval):
+
+ from formatter import AbstractFormatter, DumbWriter
+ f = AbstractFormatter(DumbWriter(maxcol=72))
+
+ msg = []
+ msg.append("A removal phase of the '%s' package " % pkg)
+ msg.append("has failed with exit value %s. " % retval)
+ msg.append("The problem occurred while executing ")
+ msg.append("the ebuild located at '%s'. " % ebuild)
+ msg.append("If necessary, manually remove the ebuild " )
+ msg.append("in order to skip the execution of removal phases.")
+
+ print
+ for x in msg:
+ f.add_flowing_data(x)
+ f.end_paragraph(1)
+
def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
print
try:
mylink.lockdb()
if mylink.exists():
- mylink.unmerge(trimworld=mytrimworld, cleanup=1,
+ retval = mylink.unmerge(trimworld=mytrimworld, cleanup=1,
ldpath_mtimes=ldpath_mtimes)
- mylink.delete()
- return 0
- return 1
+ if retval == os.EX_OK:
+ mylink.delete()
+ return retval
+ return os.EX_OK
finally:
mylink.unlockdb()
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
writemsg("!!! FAILED prerm: %s\n" % retval, noiselevel=-1)
- sys.exit(123)
+ return retval
self._unmerge_pkgfiles(pkgfiles)
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
writemsg("!!! FAILED postrm: %s\n" % retval, noiselevel=-1)
- sys.exit(123)
+ return retval
doebuild(myebuildpath, "cleanrm", self.myroot, self.settings,
tree="vartree", mydbapi=self.vartree.dbapi,
vartree=self.vartree)
portage_locks.unlockdir(catdir_lock)
env_update(target_root=self.myroot, prev_mtimes=ldpath_mtimes,
contents=contents)
+ return os.EX_OK
def _unmerge_pkgfiles(self, pkgfiles):