summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage.py26
1 files 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):