Gentoo Archives: gentoo-dev

From: yac <yac@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New eclass - twisted-r1
Date: Thu, 11 Jul 2013 11:34:19
Message-Id: 20130711133401.70b795b9@gentoo.org
In Reply to: Re: [gentoo-dev] New eclass - twisted-r1 by "Michał Górny"
1 On Thu, 11 Jul 2013 08:55:47 +0200
2 Michał Górny <mgorny@g.o> wrote:
3
4 > Dnia 2013-07-10, o godz. 23:40:11
5 > yac <yac@g.o> napisał(a):
6 >
7 > > On Wed, 10 Jul 2013 22:25:50 +0200
8 > > Michał Górny <mgorny@g.o> wrote:
9 > >
10 > > > First of all: please wrap lines at 72 or 80 chars (even if the
11 > > > original eclass didn't do that).
12 > > >
13 > > > > if [[ "${CATEGORY}/${PN}" == "dev-python/twisted"* ]]; then
14 > > >
15 > > > I know you're not responsible for this but it seems wrong to have
16 > > > two different behaviors depending on PN. Is this used somewhere
17 > > > actually?
18 > > >
19 > > > > MY_PV="${MY_PV:-${PV}}"
20 > > > > MY_P="Twisted${MY_PACKAGE}-${MY_PV}"
21 > > > >
22 > > > > HOMEPAGE="http://www.twistedmatrix.com/"
23 > > > > #SRC_URI="http://tmrc.mit.edu/mirror/twisted/${MY_PACKAGE}/$(get_version_component_range
24 > > > > 1-2 ${MY_PV})/${MY_P}.tar.bz2"
25 > > > > SRC_URI="http://twistedmatrix.com/Releases/${MY_PACKAGE}/$(get_version_component_range
26 > > > > 1-2 ${MY_PV})/${MY_P}.tar.bz2"
27 > > > >
28 > > > > LICENSE="MIT"
29 > > > > SLOT="0"
30 > > > > IUSE=""
31 > > > >
32 > > > > S="${WORKDIR}/${MY_P}"
33 > > > >
34 > > > > TWISTED_PLUGINS="${TWISTED_PLUGINS:-twisted.plugins}"
35 > > > > fi
36 > >
37 > > That's what I thought when I saw that but I found that all the
38 > > dev-python/twisted-* packages are depending on this, so I went with
39 > > it.
40 > >
41 > > Now I'm thinking I could instead provide functions
42 > > twisted-r1_twisted_src_uri and twisted-r1_twisted_build_dir used as
43 > >
44 > > SRC_URI="$(twisted-r1_twisted_src_uri)"
45 > > S="$(twisted-r1_twisted_build_dir)"
46 > >
47 > > in the depender ebuilds.
48 >
49 > I'm more-of wondering if that conditional is really necessary useful.
50 > Unless I'm missing something, the non-twisted ebuilds will replace
51 > those variables anyway, won't them?
52
53 The dev-python/twisted-* packages do rely on this. They will set just
54 MY_PACKAGE=
55
56 And the S, SRC_URI, LICENSE, SLOT, IUSE is set by the eclass.
57
58 Other than dev-python/twisted-* packages does not match, so they need
59 not to override it.
60
61 I think the main purpose is code deduplication regarding setting the
62 SRC_URI and S.

Attachments

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

Replies

Subject Author
Re: [gentoo-dev] New eclass - twisted-r1 "Michał Górny" <mgorny@g.o>