summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-30 11:57:19 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-30 11:57:19 +0000
commitca9c922d3f0f1a696963680cc491e1ef79a1336b (patch)
tree6a2857044d28e2a722022a25b83259b102db4b38
parent70633503d9ead111505f554e3aaf21bf659a399d (diff)
downloadportage-ca9c922d3f0f1a696963680cc491e1ef79a1336b.tar.gz
portage-ca9c922d3f0f1a696963680cc491e1ef79a1336b.tar.bz2
portage-ca9c922d3f0f1a696963680cc491e1ef79a1336b.zip
Pass a vartree instance into portage.unmerge() to avoid globals.
svn path=/main/trunk/; revision=3286
-rw-r--r--pym/portage.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/portage.py b/pym/portage.py
index c298ec027..2884519e6 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2613,7 +2613,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
if mydbapi is None:
mydbapi = db[myroot][tree].dbapi
- if vartree is None and (mydo in ("merge, qmerge") or \
+ if vartree is None and (mydo in ("merge", "qmerge", "unmerge") or \
"PORT_LOGDIR" in mysettings and \
mydo not in ("depend", "fetch", "digest", "manifest")):
vartree = db[myroot]["vartree"]
@@ -2677,7 +2677,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
if mydo == "unmerge":
return unmerge(mysettings["CATEGORY"],
- mysettings["PF"], myroot, mysettings)
+ mysettings["PF"], myroot, mysettings, vartree=vartree)
if "PORT_LOGDIR" in mysettings:
logfile = os.path.join(mysettings["PORT_LOGDIR"],
@@ -3041,8 +3041,9 @@ def merge(mycat, mypkg, pkgloc, infloc, myroot, mysettings, myebuild=None,
return mylink.merge(pkgloc, infloc, myroot, myebuild,
mydbapi=mydbapi, prev_mtimes=prev_mtimes)
-def unmerge(cat,pkg,myroot,mysettings,mytrimworld=1):
- mylink=dblink(cat,pkg,myroot,mysettings,treetype="vartree")
+def unmerge(cat, pkg, myroot, mysettings, mytrimworld=1, vartree=None):
+ mylink = dblink(
+ cat, pkg, myroot, mysettings, treetype="vartree", vartree=vartree)
if mylink.exists():
mylink.unmerge(trimworld=mytrimworld,cleanup=1)
mylink.delete()