1 |
Dnia 2015-06-24, o godz. 11:51:44 |
2 |
William Hubbs <williamh@g.o> napisał(a): |
3 |
|
4 |
> On Wed, Jun 24, 2015 at 05:54:31PM +0200, Michał Górny wrote: |
5 |
> > Dnia 2015-06-24, o godz. 15:38:34 |
6 |
> > "William Hubbs (williamh)" <williamh@g.o> napisał(a): |
7 |
> |
8 |
> *snip* |
9 |
> |
10 |
> > > # @FUNCTION: _golang-build_setup |
11 |
> > > # @INTERNAL |
12 |
> > > # @DESCRIPTION: |
13 |
> > > # Make sure EGO_PN has a value. |
14 |
> > > _golang-build_setup() { |
15 |
> > > [ -z "${EGO_PN}" ] && |
16 |
> > |
17 |
> > Please don't use 'unsafe' single brackets. Use bash's double brackets, |
18 |
> > i.e. [[ -z ${EGO_PN} ]]. |
19 |
> |
20 |
> Ok, this will be fixed. |
21 |
> |
22 |
> > > golang-build_src_compile() { |
23 |
> > > debug-print-function ${FUNCNAME} "$@" |
24 |
> > > |
25 |
> > > _golang-build_setup |
26 |
> > > set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \ |
27 |
> > > go build -v -work -x "${EGO_PN}" |
28 |
> > > echo "$@" |
29 |
> > |
30 |
> > I suggest to push this to stderr, >&2. |
31 |
> |
32 |
> Why? this is just printing the command before we run it. Do Make, etc |
33 |
> print this output to stderr? |
34 |
|
35 |
This is pretty much a debugging output which doesn't belong besides |
36 |
regular output. Make doesn't, bash does. |
37 |
|
38 |
> > > "$@" || die |
39 |
> > |
40 |
> > And anyway, this looks to have a common, repeating part that sounds |
41 |
> > like a good candidate for separate emake-like function... ego? :D |
42 |
> |
43 |
> Do you mean these lines: |
44 |
> |
45 |
> echo "$@" |
46 |
> "$@" || die |
47 |
|
48 |
Also the common settings for go. |
49 |
|
50 |
i.e.: |
51 |
|
52 |
set -- env GOPATH="${WORKDIR}/${P}:${EPREFIX}/usr/lib/go-gentoo" \ |
53 |
go "${@}" |
54 |
echo "${@}" |
55 |
"${@}" || die... |
56 |
|
57 |
Possibly even more arguments to go. |
58 |
|
59 |
-- |
60 |
Best regards, |
61 |
Michał Górny |
62 |
<http://dev.gentoo.org/~mgorny/> |