summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-29 05:12:12 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-29 05:12:12 +0000
commit4f91608e8dd1f4f01cbf092c833018d1e2c2527a (patch)
tree77a7706b4239aabb875e3b1b92ba93b4bc043a8d
parentffe58c875fb0113e2649e214feecc237a191734a (diff)
downloadportage-4f91608e8dd1f4f01cbf092c833018d1e2c2527a.tar.gz
portage-4f91608e8dd1f4f01cbf092c833018d1e2c2527a.tar.bz2
portage-4f91608e8dd1f4f01cbf092c833018d1e2c2527a.zip
Enable portage.pkgmerge() to work without globals.
svn path=/main/trunk/; revision=3267
-rw-r--r--pym/portage.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 4821e2a92..f3e4ea1ed 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6479,13 +6479,15 @@ def cleanup_pkgmerge(mypkg,origdir):
os.unlink(settings["PORTAGE_TMPDIR"]+"/portage/"+mypkg+"/temp/environment")
os.chdir(origdir)
-def pkgmerge(mytbz2,myroot,mysettings):
+def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None):
"""will merge a .tbz2 file, returning a list of runtime dependencies
that must be satisfied, or None if there was a merge error. This
code assumes the package exists."""
global db
- mydbapi = db[myroot]["bintree"].dbapi
- vartree = db[myroot]["vartree"]
+ if mydbapi is None:
+ mydbapi = db[myroot]["bintree"].dbapi
+ if vartree is None:
+ vartree = db[myroot]["vartree"]
if mytbz2[-5:]!=".tbz2":
print "!!! Not a .tbz2 file"
return None