summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-24 04:43:47 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-24 04:43:47 +0000
commitdd68a7ea99f05388d768056c06e2ba934aaf91bd (patch)
tree5a2def463e506341493c6f9906c30fea8290ed73 /bin
parent6a011e30ec390e479ef86c948c42817bad621901 (diff)
downloadportage-dd68a7ea99f05388d768056c06e2ba934aaf91bd.tar.gz
portage-dd68a7ea99f05388d768056c06e2ba934aaf91bd.tar.bz2
portage-dd68a7ea99f05388d768056c06e2ba934aaf91bd.zip
Remove all references to global variables from getportageversion().
svn path=/main/trunk/; revision=3633
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge20
1 files changed, 12 insertions, 8 deletions
diff --git a/bin/emerge b/bin/emerge
index 1ba7e9e28..b8f9323e1 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -306,11 +306,11 @@ def getgccversion(chost):
portage.writemsg(gcc_not_found_error, noiselevel=-1)
return "[unavailable]"
-def getportageversion():
+def getportageversion(portdir, target_root, profile, chost):
try:
import re
- profilever = os.path.normpath("///"+os.readlink(PROFILE_PATH))
- basepath = os.path.normpath("///"+portage.settings["PORTDIR"]+"/profiles")
+ profilever = os.path.normpath("///"+os.readlink(profile))
+ basepath = os.path.normpath("///" + portdir + "/profiles")
if re.match(basepath,profilever):
profilever = profilever[len(basepath)+1:]
else:
@@ -319,8 +319,8 @@ def getportageversion():
except (OSError,IOError):
profilever="unavailable"
libcver=[]
- libclist = portage.vardbapi(portage.root).match("virtual/libc")
- libclist += portage.vardbapi(portage.root).match("virtual/glibc")
+ libclist = portage.vardbapi(target_root).match("virtual/libc")
+ libclist += portage.vardbapi(target_root).match("virtual/glibc")
libclist = portage_util.unique_array(libclist)
for x in libclist:
xs=portage.catpkgsplit(x)
@@ -331,7 +331,7 @@ def getportageversion():
if libcver==[]:
libcver="unavailable"
- gccver = getgccversion(portage.settings["CHOST"])
+ gccver = getgccversion(chost)
unameout=os.uname()[2]+" "+os.uname()[4]
return "Portage " + portage.VERSION +" ("+profilever+", "+gccver+", "+libcver+", "+unameout+")"
@@ -2946,7 +2946,9 @@ def action_config(myopts, myfiles):
def action_info(myopts):
unameout=commands.getstatusoutput("uname -mrp")[1]
- print getportageversion()
+ settings = portage.settings
+ print getportageversion(settings["PORTDIR"], settings["ROOT"],
+ settings.profile_path, settings["CHOST"])
print "================================================================="
print "System uname: "+unameout
if os.path.exists("/etc/gentoo-release"):
@@ -3587,7 +3589,9 @@ if __name__ == "__main__":
EMERGE_WARNING_DELAY = string.atoi("0"+portage.settings["EMERGE_WARNING_DELAY"])
if "--version" in myopts:
- print getportageversion()
+ settings = portage.settings
+ print getportageversion(settings["PORTDIR"], settings["ROOT"],
+ settings.profile_path, settings["CHOST"])
sys.exit(0)
elif "--help" in myopts:
help()