Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: williamh@g.o
Subject: Re: [gentoo-dev] [PATCH eutils] Introduce run_in_build_dir() used in a few ebuilds.
Date: Sun, 13 Jan 2013 17:01:15
Message-Id: 20130113180134.01d0acd5@pomiocik.lan
In Reply to: Re: [gentoo-dev] [PATCH eutils] Introduce run_in_build_dir() used in a few ebuilds. by William Hubbs
1 On Sun, 13 Jan 2013 09:52:09 -0600
2 William Hubbs <williamh@g.o> wrote:
3
4 > On Sun, Jan 13, 2013 at 04:08:18PM +0100, Michał Górny wrote:
5 > > On Sun, 13 Jan 2013 09:05:31 -0600
6 > > William Hubbs <williamh@g.o> wrote:
7 > >
8 > > > On Sun, Jan 13, 2013 at 02:29:43PM +0100, Michał Górny wrote:
9 > > > > The run_in_build_dir() command simply runs given command
10 > > > > in the directory stated as BUILD_DIR. This variable is used commonly
11 > > > > by autotools-utils, cmake-utils and python-r1 eclasses, therefore I'm
12 > > > > proposing adding the relevant function to eutils.
13 > > > > ---
14 > > > > gx86/eclass/eutils.eclass | 19 +++++++++++++++++++
15 > > > > 1 file changed, 19 insertions(+)
16 > > > >
17 > > > > diff --git a/gx86/eclass/eutils.eclass b/gx86/eclass/eutils.eclass
18 > > > > index 6588792..bb3c1e3 100644
19 > > > > --- a/gx86/eclass/eutils.eclass
20 > > > > +++ b/gx86/eclass/eutils.eclass
21 > > > > @@ -1495,6 +1495,25 @@ prune_libtool_files() {
22 > > > > fi
23 > > > > }
24 > > > >
25 > > > > +# @FUNCTION: run_in_build_dir
26 > > > > +# @USAGE: <argv>...
27 > > > > +# @DESCRIPTION:
28 > > > > +# Run the given command in the directory pointed by BUILD_DIR.
29 > > >
30 > > > I think I would make this more generic if it is going in eutiles,
31 > > > e.g. rename it something like run_in_dir and pass in the directory as the
32 > > > first argument.
33 > >
34 > > That's not going to work for us since the command is subject to a loop
35 > > which sets BUILD_DIR, e.g.:
36 > >
37 > > python_foreach_impl run_in_build_dir ...
38 >
39 > Can you not change the logic so it doesn't die if build_dir isn't set,
40 > but uses the value of $1 and calls shift?
41
42 Where? What? I don't follow really. And since I don't follow, I don't
43 think that's something reasonable to do.
44
45 --
46 Best regards,
47 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature