Gentoo Archives: gentoo-dev

From: Davide Pesavento <pesa@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>, Donnie Berkholz <dberkholz@g.o>, Sergei Trofimovich <slyfox@g.o>
Subject: Re: [gentoo-dev] [PATCH 1/2] Set default EGIT_SOURCEDIR to point to standard ${WORKDIR}/${P}. It allows "${S}" overriding in user's code as other eclasses do:
Date: Tue, 27 Nov 2012 20:19:33
Message-Id: CADfzvvY+fVh7cBSxcozocMuYk=FHi4Vz_8bsCOz9Z-shrS_6ZQ@mail.gmail.com
In Reply to: [gentoo-dev] [PATCH 1/2] Set default EGIT_SOURCEDIR to point to standard ${WORKDIR}/${P}. It allows "${S}" overriding in user's code as other eclasses do: by Sergei Trofimovich
1 On Tue, Nov 27, 2012 at 11:22 AM, Sergei Trofimovich <slyfox@g.o> wrote:
2 > Before the patch I had to move subdir(not very reliable):
3 > EGIT_REPO_URI="git://github.com/UU-ComputerScience/uhc.git"
4 > src_prepare() {
5 > mv EHC/* ./ || die
6 > }
7 >
8 > After the patch i can define it the usual way:
9 > EGIT_REPO_URI="git://github.com/UU-ComputerScience/uhc.git"
10 > S="${WORKDIR}/${P}/EHC
11 >
12 > Original ebuild: https://github.com/gentoo-haskell/gentoo-haskell/blob/master/dev-lang/uhc/uhc-9999.ebuild#L27
13 >
14 > Signed-off-by: Sergei Trofimovich <slyfox@g.o>
15 > ---
16 > git-2.eclass | 4 ++--
17 > 1 file changed, 2 insertions(+), 2 deletions(-)
18 >
19 > diff --git a/git-2.eclass b/git-2.eclass
20 > index 1ecc633..1a96978 100644
21 > --- a/git-2.eclass
22 > +++ b/git-2.eclass
23 > @@ -21,7 +21,7 @@ DEPEND="dev-vcs/git"
24 > # This variable specifies destination where the cloned
25 > # data are copied to.
26 > #
27 > -# EGIT_SOURCEDIR="${S}"
28 > +# EGIT_SOURCEDIR="${WORKDIR}/${P}"
29 >
30 > # @ECLASS-VARIABLE: EGIT_STORE_DIR
31 > # @DESCRIPTION:
32 > @@ -132,7 +132,7 @@ git-2_init_variables() {
33 > local esc_pn liverepo livebranch livecommit
34 > esc_pn=${PN//[-+]/_}
35 >
36 > - : ${EGIT_SOURCEDIR="${S}"}
37 > + : ${EGIT_SOURCEDIR="${WORKDIR}/${P}"}
38 >
39 > : ${EGIT_STORE_DIR:="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/egit-src"}
40 >
41 > --
42 > 1.8.0
43 >
44 >
45
46 While in theory this makes sense, it also has the potential to break
47 ebuilds setting S="${WORKDIR}/foo" and then expecting the sources to
48 be inside "foo". IOW it's not backward compatible, is it?
49
50 Thanks,
51
52 Davide Pesavento (pesa)

Replies