1 |
On 2016-01-25 10:31, Ian Stakenvicius wrote: |
2 |
> On 23/01/16 10:51 AM, Ian Stakenvicius wrote: |
3 |
> >> On Jan 22, 2016, at 3:11 PM, Aaron W. Swenson |
4 |
> >> <titanofold@g.o> wrote: |
5 |
> >> |
6 |
> >> I would like some feedback on the documentation/comments in |
7 |
> >> the eclass. I'm certain it could be improved. Though, if you |
8 |
> >> were able to follow them (not a slight, just you were the first |
9 |
> >> to follow them), I might have done good enough. |
10 |
> >> |
11 |
> > |
12 |
> > I'll have another look; i don't think I read any of the docs, |
13 |
> > just looked to see that PG_CONFIG was set for me and confirmed |
14 |
> > things looked to work the same as multilib-minimal. |
15 |
> |
16 |
> OK here's my full review (with docs and all): |
17 |
> |
18 |
> postgres.eclass: |
19 |
> |
20 |
> postgres_check_slot() <-- #1, not seeing a need for this as |
21 |
> dependencies should be forced now due to USE flag provisions. #2, |
22 |
> though, the documentation says it should be used in pkg_pretend but |
23 |
> then in the code there's an exclusion to make it a no-op when it's |
24 |
> run in pkg_pretend. Perhaps it's supposed to be run in pkg_setup?? |
25 |
|
26 |
I'm a bit uncertain what to do with this. There are a few ebuilds that |
27 |
check that the slot is set properly, and they do so as early as possible |
28 |
so the user doesn't start the emerge and walk away thinking everything |
29 |
will be okay. So, it tries to run the check, but won't die if the |
30 |
PostgreSQL eselect module hasn't been emerged yet. |
31 |
|
32 |
I could probably replace it with a pkg_setup that sets the PG_CONFIG |
33 |
variable globally. |
34 |
|
35 |
But, this would probably require another USE_EXPAND to do a single |
36 |
target. I'm not against this, I just don't want to go use flag crazy. |
37 |
|
38 |
> postgres_new_user() <-- the documentation seems a little bit unclear |
39 |
> on this one.. It looks like it creates the 'postgres' user/group |
40 |
> and optionally it also creates an additional specified user/group.. |
41 |
> But i'm not sure how creating new users/groups here instead of with |
42 |
> calling enewuser/enewgroup directly in the ebuild is helpful per |
43 |
> se...? It also seems a bit redundant if you wanted to create say, 2 |
44 |
> or 3 extra users/groups, to repeatedly call enewuser postgres .... |
45 |
|
46 |
You're right about how it works. I could scratch the rest of the |
47 |
function and have it just create the postgres system group and |
48 |
user. It's intended to make it so that a developer doesn't have to look |
49 |
up the postgres system user and group parameters in another ebuild, or |
50 |
dig around for nonexistent documentation, which will be rectified but |
51 |
that'll still be difficult to search. |
52 |
|
53 |
> postgres-multi.eclass: |
54 |
> |
55 |
> #1 - main description could perhaps be changed from: |
56 |
> |
57 |
> # build against any and all compatible PostgreSQL slots that are also |
58 |
> # enabled by the user. |
59 |
> |
60 |
> to: |
61 |
> |
62 |
> # build and install for one or more PostgreSQL slots as specified by |
63 |
> # POSTGRES_TARGETS use flags. |
64 |
|
65 |
Done. |
66 |
|
67 |
> #2 - POSTGRES_COMPAT , needs an example and/or text to describe the |
68 |
> syntax of the slot specification. |
69 |
|
70 |
Done. |
71 |
|
72 |
> #3 - _POSTGRES_UNION_SLOTS -- you actually mean here the |
73 |
> intersection between the two sets, rather than the union, right? |
74 |
> Var can likely stay as-is but the description should probably be |
75 |
> updated. |
76 |
|
77 |
Well, that's a bit embarrassing. You'd think I'd know the difference by |
78 |
now. Renamed it _POSTGRES_INTERSECT_SLOTS and corrected other |
79 |
appearances of union. |
80 |
|
81 |
> #4 - postgres-multi_foreach() -- this actually runs in the builddir, |
82 |
> not the source dir as mentioned in the text. |
83 |
|
84 |
Done. |
85 |
|
86 |
> #5 - postgres-multi_forbest() -- maybe expand on what the "best" |
87 |
> slot is here, ie that it's the lexicographically biggest slot rather |
88 |
> than something else (like, say, the slot that's currently eselected) |
89 |
|
90 |
Done. |
91 |
|
92 |
> #6 - need docs for postgres-multi_src_prepare() and so forth -- just |
93 |
> simple stuff will suffice I think: postgres-multi_src_prepare() |
94 |
> copies ${S} into a build directory for each target PG_SLOT and |
95 |
> should be specified; the others are default functions that are |
96 |
> provided for convenience, but postgres-multi_foreach should be used |
97 |
> instead of these when customization is necessary. |
98 |
|
99 |
Done. |
100 |
|
101 |
> ...and I think that's it.. |
102 |
|
103 |
Thanks! |