Gentoo Archives: gentoo-dev

From: Jeroen Roovers <jer@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Defining S= from ebuild phase, src_unpack() ?
Date: Mon, 03 Jan 2011 20:12:06
Message-Id: 20110103211002.044662f9@epia.jer-c2.orkz.net
In Reply to: Re: [gentoo-dev] Defining S= from ebuild phase, src_unpack() ? by Thomas Sachau
1 On Mon, 03 Jan 2011 19:16:13 +0100
2 Thomas Sachau <tommy@g.o> wrote:
3
4 > src_unpack() {
5 > unpack ${A}
6 > mv *-${PN}-* "${S}"
7 > }
8 >
9 > This saves a line and does not require the redefinition of S inside
10 > the function.
11
12 It should probably die() though. I've looked at opera tarballs again,
13 and in fact they are still varying the directory based on both the OS
14 and the arch.
15
16 The "x86-fbsd" tarball has "opera-11.00-1156.i386.freebsd" whereas plain
17 "x86" is brought to users as "opera-11.00-1156.i386.linux". This isn't
18 the reason why I started modifying S based on what had been unpacked,
19 though - it was becomes sometimes I'd see "opera_11.00-1156.i386.linux"
20 instead of "opera-11.00-1156.i386.linux" too, and other punctuational
21 flux.
22
23 Anyway, I've gone now from many lines to a single extra line in
24 src_unpack():
25
26
27 --- opera-11.00.1156.ebuild 22 Dec 2010 16:14:34 -0000 1.3
28 +++ opera-11.00.1156.ebuild 3 Jan 2011 20:06:25 -0000 1.5
29
30 src_unpack() {
31 unpack ${A}
32 - if [[ ! -d ${S} ]]; then
33 - cd "${WORKDIR}"/${PN}* || die "failed to enter work
34 directory"
35 - S="$(pwd)"
36 - einfo "Setting WORKDIR to ${S}"
37 - fi
38 + mv -v * "${S}" || die
39 }
40
41 src_prepare() {
42
43
44 That sure helped.
45
46
47 jer