From: Zac Medico Date: Sat, 28 Jul 2007 03:07:07 +0000 (-0000) Subject: Handle 2 more cases where elog_process() needs to be called: X-Git-Tag: v2.1.3~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5fc538f681907b7ab0d9ca0a185bc566eff9776e;p=portage.git Handle 2 more cases where elog_process() needs to be called: - binary install via pkgmerge() fails before reaching the merge phase (pkg_setup dies) - doebuild() is called for the merge phase but it dies before reaching the merge phase (trunk r7417) svn path=/main/branches/2.1.2/; revision=7418 --- diff --git a/pym/portage.py b/pym/portage.py index e03643292..eaca567c2 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -4012,6 +4012,11 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, elif mydo=="merge": retval = spawnebuild("install", actionmap, mysettings, debug, alwaysdep=1, logfile=logfile) + if retval != os.EX_OK: + # The merge phase handles this already. Callers don't know how + # far this function got, so we have to call elog_process() here + # so that it's only called once. + elog_process(mysettings.mycpv, mysettings) if retval == os.EX_OK: retval = merge(mysettings["CATEGORY"], mysettings["PF"], mysettings["D"], os.path.join(mysettings["PORTAGE_BUILDDIR"], @@ -8335,6 +8340,9 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes tbz2_lock = None builddir_lock = None catdir_lock = None + mycat = None + mypkg = None + did_merge_phase = False try: """ Don't lock the tbz2 file because the filesytem could be readonly or shared by a cluster.""" @@ -8407,11 +8415,17 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes treetype="bintree") retval = mylink.merge(pkgloc, infloc, myroot, myebuild, cleanup=0, mydbapi=mydbapi, prev_mtimes=prev_mtimes) + did_merge_phase = True return retval finally: if tbz2_lock: portage_locks.unlockfile(tbz2_lock) if builddir_lock: + if not did_merge_phase: + # The merge phase handles this already. Callers don't know how + # far this function got, so we have to call elog_process() here + # so that it's only called once. + elog_process(mycat + "/" + mypkg, mysettings) try: shutil.rmtree(builddir) except (IOError, OSError), e: