as seen in the reproduction steps, emerge has to be entered twice when ran from an user terminal. especially in kde where an user terminal is easily available, but open root terminals bear a security risk, this would come in handy. it would be nice if emerge would ask for the root password, then run the command issued in root context, finally returning to the original user prompt. Reproducible: Always Steps to Reproduce: paniq@zeitgeist ~ $ emerge --pretend kdevelop *** You are not in the portage group. You may experience cache problems *** due to permissions preventing the creation of the on-disk cache. *** Please add this user to the portage group if you wish to use portage. These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] dev-util/kdevelop-3.1.2 Failed to write to mtimedb: [Errno 13] Permission denied: '/var/cache/edb/mtimedb' paniq@zeitgeist ~ $ su Password: zeitgeist paniq # emerge --pretend kdevelop These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] dev-util/kdevelop-3.1.2 zeitgeist paniq #
if you simply add your user to the portage group the example you show would not display an error at any rate, i think adding 'su' code to emerge isnt worth the complexity
from within kde, i did just that, using the KUser application, but that had no effect (but thats a different issue). I guess KUser modifies a shadow file, not the actual user configuration. would it be okay then to just display the command additionally to the help text that adds this user to the portage tree?
For the su thing, definite no (would probably need a wrapper around emerge). For the message, well, there are multiple ways to add someone to a group, and I'm not sure that there is one standard way that works the same everyway (macos, bsd, other shells, ...). And your problem probably was that you have to logout and login again for group changes to take effect, independent of the way you've added your user to the group.