From b3670dbc01e9e0074734e5c863c045c7c2e09122 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 26 May 2006 01:59:13 +0000 Subject: [PATCH] Reset DISTDIR to it's original value before returning from doebuild() in order to prevent unexpected values for DISTDIR later on. svn path=/main/trunk/; revision=3415 --- pym/portage.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index e46e3b62d..d604c9bae 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2907,7 +2907,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, if not os.path.exists(mysettings["PKGDIR"]+x): os.makedirs(mysettings["PKGDIR"]+x) # REBUILD CODE FOR TBZ2 --- XXXX - return spawnebuild(mydo,actionmap,mysettings,debug,logfile=logfile) + retval = spawnebuild(mydo, actionmap, mysettings, debug, logfile=logfile) elif mydo=="qmerge": #check to ensure install was run. this *only* pops up when users forget it and are using ebuild if not os.path.exists(mysettings["PORTAGE_BUILDDIR"]+"/.installed"): @@ -2917,22 +2917,30 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, if "noclean" not in mysettings.features: mysettings.features.append("noclean") #qmerge is specifically not supposed to do a runtime dep check - return merge(mysettings["CATEGORY"], mysettings["PF"], mysettings["D"], + retval = merge(mysettings["CATEGORY"], mysettings["PF"], mysettings["D"], os.path.join(mysettings["PORTAGE_BUILDDIR"], "build-info"), myroot, mysettings, myebuild=mysettings["EBUILD"], mytree=tree, mydbapi=mydbapi, vartree=vartree, prev_mtimes=prev_mtimes) elif mydo=="merge": - retval=spawnebuild("install",actionmap,mysettings,debug,alwaysdep=1,logfile=logfile) - if retval: - return retval - return merge(mysettings["CATEGORY"], mysettings["PF"], mysettings["D"], - os.path.join(mysettings["PORTAGE_BUILDDIR"], "build-info"), myroot, - mysettings, myebuild=mysettings["EBUILD"], mytree=tree, - mydbapi=mydbapi, vartree=vartree, prev_mtimes=prev_mtimes) + retval = spawnebuild("install", actionmap, mysettings, debug, + alwaysdep=1, logfile=logfile) + if retval == os.EX_OK: + retval = merge(mysettings["CATEGORY"], mysettings["PF"], + mysettings["D"], os.path.join(mysettings["PORTAGE_BUILDDIR"], + "build-info"), myroot, mysettings, + myebuild=mysettings["EBUILD"], mytree=tree, mydbapi=mydbapi, + vartree=vartree, prev_mtimes=prev_mtimes) else: print "!!! Unknown mydo:",mydo sys.exit(1) + # Make sure that DISTDIR is restored to it's normal value before we return! + if "PORTAGE_ACTUAL_DISTDIR" in mysettings: + mysettings["DISTDIR"] = mysettings["PORTAGE_ACTUAL_DISTDIR"] + del mysettings["PORTAGE_ACTUAL_DISTDIR"] + + return retval + expandcache={} def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): -- 2.26.2