On my University's shell server, each user is assigned their own group, but these groups are only numeric and not named. This upsets the version of portage used in gentoo-prefix. Reproducible: Always Steps to Reproduce: 1. have a user account whose primary group is numeric 2. run any emerge command Actual Results: $ time FEATURES="-collision-protect" emerge -avg system Traceback (most recent call last): File "/home/tom/gentoo/usr/bin/emerge", line 38, in <module> from _emerge.main import emerge_main File "/home/tom/gentoo/usr/lib/portage/pym/_emerge/main.py", line 31, in <module> import portage.locks File "/home/tom/gentoo/usr/lib/portage/pym/portage/locks.py", line 16, in <module> from portage.data import portage_gid File "/home/tom/gentoo/usr/lib/portage/pym/portage/data.py", line 96, in <module> "portage: "+portageuser+" user or "+portagegroup+" group missing.") + "\n", noiselevel=-1) NameError: name 'portageuser' is not defined Expected Results: ran emerge as normal The attached diff fixes the problem for me, but is no good for a general case.
Created attachment 253329 [details, diff] add case for numeric group id
Created attachment 253331 [details, diff] fix of previous patch
can you post the output of `id`? does portage_gid = grp.getgrgid(_portage_grpname)[2] return anything?
$ id uid=15342(tam9) gid=15342 groups=15342 $ python -c 'import grp; grp.getgrgid("15342")' Traceback (most recent call last): File "<string>", line 1, in <module> KeyError: 'getgrgid(): gid not found: 15342'
Created attachment 255981 [details, diff] portage-numeric-group I'm going to commit this patch, which should deal with your issue, I hope.
the fix is in 2.2.01.17304
Created attachment 368474 [details, diff] portage-numeric-group.patch This is broken again in current portage; reopening. Attached patch fixes it.
Created attachment 368490 [details, diff] portage-numeric-group.patch This version also works with python 3, unlike the previous version.
[prefix 1604d62] portage_gid: allow numeric groups
Fixed in 2.2.10.