Gentoo Archives: gentoo-portage-dev

From: Douglas Freed <dwfreed@×××.edu>
To: gentoo-portage-dev@l.g.o
Cc: Douglas Freed <dwfreed@×××.edu>
Subject: [gentoo-portage-dev] [PATCH] emerge/actions: Add python version to portage version line
Date: Sun, 06 Apr 2014 08:33:49
Message-Id: 1396773185-31527-1-git-send-email-dwfreed@mtu.edu
Adds the currently running python version to the portage version line,
so that it's immediately obvious what version of python is being used to
run portage
---
 pym/_emerge/actions.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 2a1354b..9bc6ed1 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2996,6 +2996,7 @@ def relative_profile_path(portdir, abs_profile):
 	return profilever
 
 def getportageversion(portdir, _unused, profile, chost, vardb):
+	pythonver = 'python %d.%d.%d-%s-%d' % sys.version_info
 	profilever = None
 	repositories = vardb.settings.repositories
 	if profile:
@@ -3051,8 +3052,8 @@ def getportageversion(portdir, _unused, profile, chost, vardb):
 	gccver = getgccversion(chost)
 	unameout=platform.release()+" "+platform.machine()
 
-	return "Portage %s (%s, %s, %s, %s)" % \
-		(portage.VERSION, profilever, gccver, ",".join(libcver), unameout)
+	return "Portage %s (%s, %s, %s, %s, %s)" % \
+		(portage.VERSION, pythonver, profilever, gccver, ",".join(libcver), unameout)
 
 def git_sync_timestamps(portdb, portdir):
 	"""
-- 
1.9.1

Replies