Gentoo Archives: gentoo-dev

From: "Aaron W. Swenson" <titanofold@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New Eclasses: postgres and postgres-multi
Date: Fri, 15 Jan 2016 16:46:33
Message-Id: 20160115164308.GA1984@gengoff.gsmr1.local
In Reply to: Re: [gentoo-dev] New Eclasses: postgres and postgres-multi by Ian Stakenvicius
1 On 2016-01-13 11:11, Ian Stakenvicius wrote:
2 > The work looks really good, but I noticed that postgres-multi
3 > determins the variants to build against based on what's installed on
4 > disk via checking eselect.. I think it'd likely be better to
5 > instead have proper dependencies based on USE, much like how the
6 > python and ABI_* multibuilds work. That would make the
7 > installations as well as the dependencies be determinstic rather
8 > than dynamic, which should support binpkgs -much- better (among
9 > other things).
10 >
11 > The "|| ( postgresql:${SLOT1}= postgresql:${SLOT2}= ...)" RDEPEND
12 > that postgres.eclass works out is a little sketchy IMO,
13 > unfortunately, as the behaviour that occurs when more than one of
14 > those slots are installed is afaik a little unstable -- in theory,
15 > changes (including removal) of any of the options should trigger a
16 > rebuild but I don't know if it does, and I'm fairly certain that a
17 > simple --unmerge doesn't trigger a rebuild. All of that goes away
18 > if you perform non-OR dependency via use flags.
19 >
20 > The drawback of course is yet another USE_EXPAND, or at least a
21 > bunch of rather long use flags, that will need setting by the user.
22
23 What if I made a small adjustment to the DEPEND building like so:
24
25 - POSTGRES_DEP="|| ("
26 + POSTGRES_REQ_USE=" || ("
27 for slot in "${POSTGRES_COMPAT[@]}" ; do
28 + IUSE+=" postgres_${slot}"
29 + POSTGRES_REQ_USE+=" postgres_${slot}"
30 +
31 + ! use "postgres_${slot/_/.}" && continue
32 POSTGRES_DEP+=" dev-db/postgresql:${slot}="
33 declare -p POSTGRES_USEDEP &>/dev/null && \
34 POSTGRES_DEP+="[${POSTGRES_USEDEP}]"
35 done
36 - POSTGRES_DEP+=" )"
37 + POSTGRES_REQ_USE=" )"
38
39 I'll have to change from listing the slots in POSTGRES_COMPAT from N.N
40 to N_N, but that's not terribly difficult given the one ebuild I have it
41 in.
42
43 Is this a change that would require a USE_EXPAND? I know I'll have to
44 document the USE flags globally.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] New Eclasses: postgres and postgres-multi Ian Stakenvicius <axs@g.o>