From 5cdb58aa8e597fdc76baf4b1bb390ebc4fa5373c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 29 Jun 2006 05:11:47 +0000 Subject: [PATCH] Pass a vardbapi instance into getportageversion() so that it doesn't have to construct one itself. svn path=/main/trunk/; revision=3691 --- bin/emerge | 13 ++++++++----- 1 file 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) -- 2.26.2