diff options
author | Zac Medico <zmedico@gmail.com> | 2010-03-23 20:03:51 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gmail.com> | 2010-03-23 20:03:51 -0700 |
commit | cd003fd10f92eed2a7f932d3be85935c321d1097 (patch) | |
tree | 3ff338f65d371b41ec7e2c3edd5c83072951027f /pym/portage/data.py | |
parent | Add check of herds in metadata.xml (diff) | |
download | portage-cd003fd10f92eed2a7f932d3be85935c321d1097.tar.gz portage-cd003fd10f92eed2a7f932d3be85935c321d1097.tar.bz2 portage-cd003fd10f92eed2a7f932d3be85935c321d1097.zip |
Add support for PORTAGE_USERNAME and PORTAGE_GROUPNAME environment
variables. Thanks to Alec Warner <antarus@g.o> for submitting the
initial PORTAGE_USERNAME patch from chromiumos-overlay.
Diffstat (limited to 'pym/portage/data.py')
-rw-r--r-- | pym/portage/data.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage/data.py b/pym/portage/data.py index c82a8b625..6322a6ab9 100644 --- a/pym/portage/data.py +++ b/pym/portage/data.py @@ -4,6 +4,7 @@ # $Id$ import os, sys, pwd, grp, platform +from portage.const import PORTAGE_GROUPNAME, PORTAGE_USERNAME import portage portage.proxy.lazyimport.lazyimport(globals(), @@ -77,8 +78,8 @@ except KeyError: #Discover the uid and gid of the portage user/group try: - portage_uid=pwd.getpwnam("portage")[2] - portage_gid=grp.getgrnam("portage")[2] + portage_uid = pwd.getpwnam(PORTAGE_USERNAME)[2] + portage_gid = grp.getgrnam(PORTAGE_GROUPNAME)[2] if secpass < 1 and portage_gid in os.getgroups(): secpass=1 except KeyError: |