1 |
Hi everyone, |
2 |
|
3 |
I have not started to write it, but I am considering it and rather want |
4 |
to gather feedback on my idea first. |
5 |
I am aware that https://wiki.gentoo.org/wiki/GLEP:27 exists, but as of |
6 |
right now I haven't seen anyone working on it. The goal of this eclass |
7 |
is to improve user/group handling without touching the PMS. |
8 |
|
9 |
tl;dr: Userkit eclass will improve the user handling by externalizing |
10 |
the configuration to variables that can be set from outside of the ebuild. |
11 |
|
12 |
Userkit.eclass will inherit user.eclass and require bash arrays |
13 |
USERKIT_USER and USERKIT_GROUP for configuration. |
14 |
I will export a pkg_setup with the corresponding setup (basically |
15 |
calling enewuser and enewgroup). It will provide get_user, get_uid, |
16 |
get_group, get_gid and get_home functions. |
17 |
This would allow to do something like "fowners $(get_user):$(get_group) |
18 |
foo". |
19 |
|
20 |
If ${CATEGORY}-${PN}_user and ${CATEGORY}-${PN}_group are set, these |
21 |
will replace the contents of USERKIT_USER and USERKIT_GROUP, allowing |
22 |
the user to fully define everything user/group related. |
23 |
|
24 |
It will also be possible to enable a switch to that makes the ebuild |
25 |
fail if those are not set, as you then can set those variables first. |
26 |
Another one allows to make them nops (which is nice for testing the |
27 |
ebuild via "ebuild $PN test"). |
28 |
|
29 |
My only concerns right now are: |
30 |
Where to store those ${CATEGORY}-${PN}_user and ${CATEGORY}-${PN}_group? |
31 |
One solution could be to have another eclass named userkit-data.eclass, |
32 |
which is empty by default and needs to be forked to an overlay and then |
33 |
use the eclass-override setting in repos.conf. Unfortunately this will |
34 |
cause a lot of md5-cache rewrites. |
35 |
Another solution would be portage/package.env or portage/env. |
36 |
|
37 |
What happens if the ebuild wants to create multiple users/group? |
38 |
Currently, I want to ignore that case and focus on the 80% ebuilds that |
39 |
can profit from such an eclass. |
40 |
|
41 |
Any thoughts? |
42 |
|
43 |
Cheers, |
44 |
|
45 |
Manuel |