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:
sets["world"].cleanPackage(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(sys.stderr, 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.")
-
- f.end_paragraph(1)
- for x in msg:
- f.add_flowing_data(x)
- f.end_paragraph(1)
- f.writer.flush()
-
def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
if os.path.exists("/usr/bin/install-info"):
# Now, don't assume that the name of the ebuild is the same as the
# name of the dir; the package may have been moved.
myebuildpath = None
+ ebuild_phase = "prerm"
mystuff = listdir(self.dbdir, EmptyOnError=1)
for x in mystuff:
if x.endswith(".ebuild"):
self.vartree.dbapi.plib_registry.unregister(self.mycpv, self.settings["SLOT"], self.settings["COUNTER"])
if myebuildpath:
+ ebuild_phase = "postrm"
retval = doebuild(myebuildpath, "postrm", self.myroot,
self.settings, use_cache=0, tree="vartree",
mydbapi=self.vartree.dbapi, vartree=self.vartree)
if builddir_lock:
try:
if myebuildpath:
+ if retval != os.EX_OK:
+ msg = ("The '%s' " % ebuild_phase) + \
+ ("phase of the '%s' package " % self.mycpv) + \
+ ("has failed with exit value %s. " % retval) + \
+ "The problem occurred while executing " + \
+ ("the ebuild located at '%s'. " % myebuildpath) + \
+ "If necessary, manually remove the ebuild " + \
+ "in order to skip the execution of removal phases."
+ from portage.elog.messages import eerror
+ from textwrap import wrap
+ for l in wrap(msg, 72):
+ eerror(l, phase=ebuild_phase, key=self.mycpv)
+
# process logs created during pre/postrm
elog_process(self.mycpv, self.settings, phasefilter=filter_unmergephases)
if retval == os.EX_OK: