summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-29 05:11:47 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-29 05:11:47 +0000
commit5cdb58aa8e597fdc76baf4b1bb390ebc4fa5373c (patch)
tree26c5e661808c8c4d3fe63e4edc566dd6779d3b38
parentb8c3d1f9fde25c5c5d2e505913c2b35c0b67aea4 (diff)
downloadportage-5cdb58aa8e597fdc76baf4b1bb390ebc4fa5373c.tar.gz
portage-5cdb58aa8e597fdc76baf4b1bb390ebc4fa5373c.tar.bz2
portage-5cdb58aa8e597fdc76baf4b1bb390ebc4fa5373c.zip
Pass a vardbapi instance into getportageversion() so that it doesn't have to construct one itself.
svn path=/main/trunk/; revision=3691
-rwxr-xr-xbin/emerge13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/emerge b/bin/emerge
index 7d8eb79b5..a9b131c2a 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -305,7 +305,7 @@ def getgccversion(chost):
portage.writemsg(gcc_not_found_error, noiselevel=-1)
return "[unavailable]"
-def getportageversion(portdir, target_root, profile, chost):
+def getportageversion(portdir, target_root, profile, chost, vardb):
try:
import re
profilever = os.path.normpath("///"+os.readlink(profile))
@@ -318,8 +318,8 @@ def getportageversion(portdir, target_root, profile, chost):
except (OSError,IOError):
profilever="unavailable"
libcver=[]
- libclist = portage.vardbapi(target_root).match("virtual/libc")
- libclist += portage.vardbapi(target_root).match("virtual/glibc")
+ libclist = vardb.match("virtual/libc")
+ libclist += vardb.match("virtual/glibc")
libclist = portage_util.unique_array(libclist)
for x in libclist:
xs=portage.catpkgsplit(x)
@@ -3015,8 +3015,10 @@ def action_config(myopts, myfiles):
def action_info(myopts):
unameout=commands.getstatusoutput("uname -mrp")[1]
settings = portage.settings
+ trees = portage.db
print getportageversion(settings["PORTDIR"], settings["ROOT"],
- settings.profile_path, settings["CHOST"])
+ settings.profile_path, settings["CHOST"],
+ trees[settings["ROOT"]]["vartree"].dbapi)
print "================================================================="
print "System uname: "+unameout
if os.path.exists("/etc/gentoo-release"):
@@ -3719,7 +3721,8 @@ def emerge_main():
if "--version" in myopts:
settings = portage.settings
print getportageversion(settings["PORTDIR"], settings["ROOT"],
- settings.profile_path, settings["CHOST"])
+ settings.profile_path, settings["CHOST"],
+ trees[settings["ROOT"]]["vartree"].dbapi)
sys.exit(0)
elif "--help" in myopts:
emergehelp.help(myaction, myopts, havecolor)