Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Jvcs-snapshot.eclass: add a way to specify the extraction path
Date: Fri, 31 Jul 2015 20:35:26
Message-Id: CAJ0EP40Us77vCxtLkN4LOzQ+gBcOKH7Ccc7krUOrHLMC+ET2wg@mail.gmail.com
In Reply to: Re: [gentoo-dev] Jvcs-snapshot.eclass: add a way to specify the extraction path by William Hubbs
1 On Fri, Jul 31, 2015 at 10:44 AM, William Hubbs <williamh@g.o> wrote:
2 > On Thu, Jul 30, 2015 at 05:11:20PM -0400, Mike Gilbert wrote:
3 >> On Thu, Jul 30, 2015 at 11:57 AM, William Hubbs <williamh@g.o> wrote:
4 >> > All,
5 >> >
6 >> > I'm finding in working on Go ebuilds, that we are propegating a
7 >> > src_unpack function that is very similar to the one in vcs-snapshot.
8 >> >
9 >> > This patch adds an EXTRACT_PATH variable to the vcs-snapshot eclass
10 >> > which, if set, puts the extracted archives in the specified directory under ${S}.
11 >> >
12 >> > If it is not set, nothing should happen.
13 >> >
14 >> > This could be used by other types of ebuilds later, but for now it would
15 >> > be used by Go ebuilds.
16 >> >
17 >> > Thoughts?
18 >>
19 >> Can you provide an example of an ebuild in the tree for which this
20 >> would be useful?
21 >
22 > Sure,
23 >
24 > Take a look at dev-go/go-snappy and most of the dev-go ebuilds.
25 >
26 > They use a src_unpack function for the non-live side that is almost
27 > exactly like vcs-snapshot except for the extraction location.
28 >
29 >> I'm unclear as to why tarballs are being unpacked in sub-directories of ${S}.
30 >
31 > For Go software that just uses the Go tools to build, it is easiest to
32 > work with if you treat ${S} as a Go Workspace [1].
33 >
34 > I could write my own golang-vcs-snapshot.eclass that does this, but I
35 > thought it would be easier to leverage code that is already in the tree.
36
37 The thing I find a bit awkward here is that vcs-snapshot_src_unpack
38 will automatically unpack multiple tarballs into separate directories.
39 As soon as you set EXTRACT_PATH, you break that; all tarballs get
40 unpacked into a single directory.
41
42 I think sharing code often a good thing, but I think some refactoring
43 is in order before it will be possible here.
44
45 Since go does things rather strangely, it may make more since to
46 maintain your own version of this function in another eclass.