Pretend that the current user's uid/gid are the 'portage' uid/gid,
authorZac Medico <zmedico@gentoo.org>
Tue, 10 Aug 2010 09:20:33 +0000 (02:20 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 10 Aug 2010 09:20:33 +0000 (02:20 -0700)
so things go smoothly regardless of the current user and global
user/group configuration.

pym/portage/tests/runTests

index a6f3b8f1c6051312e1f85d479852276b4369786b..9600f12a73ede5c5b0653fae340fabc18808755b 100755 (executable)
@@ -5,6 +5,13 @@
 
 import os, sys
 import os.path as osp
+import grp
+
+# Pretend that the current user's uid/gid are the 'portage' uid/gid,
+# so things go smoothly regardless of the current user and global
+# user/group configuration.
+os.environ["PORTAGE_USERNAME"] = os.getlogin()
+os.environ["PORTAGE_GRPNAME"] = grp.getgrgid(os.getgid()).gr_name
 
 # Insert our parent dir so we can do shiny import "tests"
 # This line courtesy of Marienz and Pkgcore ;)