Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>, William Hubbs <williamh@g.o>
Subject: Re: [gentoo-dev] new eclass: golang-vcs-snapshot.eclass for golang vcs snapshots
Date: Tue, 04 Aug 2015 16:18:20
Message-Id: CAJ0EP40BdYyG_uccNeGfb38Ki2L1-t1fQjD-BgmABo0kS17w_g@mail.gmail.com
In Reply to: [gentoo-dev] new eclass: golang-vcs-snapshot.eclass for golang vcs snapshots by William Hubbs
1 On Mon, Aug 3, 2015 at 8:20 PM, William Hubbs <williamh@g.o> wrote:
2 > This eclass is meant to handle vcs snapshots of golang packages coming
3 > from services like github.
4 >
5 > Let me know what you think.
6 >
7 > William
8 >
9 > # The location where the tarball is extracted is defined as
10 > # ${S}/src/${EGO_PN}.
11 >
12 > # @FUNCTION: golang-vcs-snapshot_src_unpack
13 >
14 > # @DESCRIPTION:
15 > # Extract the first archive from ${A} to the appropriate location for GOPATH.
16 > golang-vcs-snapshot_src_unpack() {
17 > local f destdir="${WORKDIR}/${P}" x
18 > ego_pn_check
19 > set -- ${A}
20 > x="$1"
21 > mkdir -p "${destdir}/src/${EGO_PN%/*}"
22 > tar -C "${destdir}/src/${EGO_PN%/*}" -x --strip-components 1 \
23 > -f "${DISTDIR}/${x}" || die
24 > }
25
26 The documentation says you are extracting to ${S}, but the function
27 actually extracts to ${WORKDIR}/${PN}.
28
29 I would get rid of the useless "destdir" variable and replace all
30 usages with "${S}". Or update the docs.

Replies