Shouldn't there be checking for errors here, for the case that insinto
fails?
> + doins "${@}"
> + )
> +}
Ulrich
08-16-2012, 08:45 PM
Michał Górny
Add dointo && newinto.
On Thu, 16 Aug 2012 13:29:50 -0700
Diego Elio Pettenò <flameeyes@flameeyes.eu> wrote:
> On 16/08/2012 13:19, Michał Górny wrote:
> > eutils.eclass | 37 +++++++++++++++++++++++++++++++++++++
>
> I would say "no", and let's queue this for the next EAPI.
>
> The reason being we have everything ${foo}into {new,do}${foo},
> provided by EAPI and utils as well, why should foo=ins be different
> now?
I'd be happy to see that in a new EAPI but please note that a lot
of eclasses inlines that thing right now.
We can remove it from eutils when it gets into EAPI (i.e. make
conditional to older EAPIs). This will keep things both usable
and clean.
--
Best regards,
Michał Górny
08-16-2012, 08:45 PM
Diego Elio Pettenò
Add dointo && newinto.
On 16/08/2012 13:45, Michał Górny wrote:
>
> We can remove it from eutils when it gets into EAPI (i.e. make
> conditional to older EAPIs). This will keep things both usable
> and clean.
I still don't like it — I definitely don't like changing the approach
midway and halfway.
So my 2 cents here keep saying "no".
--
Diego Elio Pettenò — Flameeyes
flameeyes@flameeyes.eu — http://blog.flameeyes.eu/
08-16-2012, 08:46 PM
Michał Górny
Add dointo && newinto.
On Thu, 16 Aug 2012 22:36:46 +0200
Ulrich Mueller <ulm@gentoo.org> wrote:
> >>>>> On Thu, 16 Aug 2012, Michał Górny wrote:
>
> > +dointo() {
> > + [[ ${#} -gt 2 ]] || die 'Synopsis: dointo <directory>
> > <file> [...]' +
> > + local directory=${1}
> > + shift
> > +
> > + (
> > + insinto "${directory}"
>
> Shouldn't there be checking for errors here, for the case that insinto
> fails?
Hmm, I don't even know if insinto should ever fail. And if it does,
then the following doins should fail as well, I guess.
But I see no problem adding '&& ' there if necessary.
> > + doins "${@}"
--
Best regards,
Michał Górny
08-16-2012, 09:23 PM
Michał Górny
Add dointo && newinto.
On Thu, 16 Aug 2012 13:45:50 -0700
Diego Elio Pettenò <flameeyes@flameeyes.eu> wrote:
> On 16/08/2012 13:45, Michał Górny wrote:
> >
> > We can remove it from eutils when it gets into EAPI (i.e. make
> > conditional to older EAPIs). This will keep things both usable
> > and clean.
>
> I still don't like it — I definitely don't like changing the approach
> midway and halfway.
>
> So my 2 cents here keep saying "no".
Well, in that case it is pointless to add it to EAPI since almost no
ebuild will use it.
The main benefit of these functions is to eclasses which now inline
the same code. I really don't see them replacing:
(
insinto /foo
doins $@
)
with:
case $EAPI in
5)
dointo /foo $@
;;
*)
(
insinto /foo
doins $@
)
;;
esac
What's the point of simplifications which actually make things
harder?
--
Best regards,
Michał Górny
08-16-2012, 10:02 PM
Ulrich Mueller
Add dointo && newinto.
>>>>> On Thu, 16 Aug 2012, Michał Górny wrote:
>> > +dointo() {
>> > + [[ ${#} -gt 2 ]] || die 'Synopsis: dointo <directory>
>> > <file> [...]' +
>> > + local directory=${1}
>> > + shift
>> > +
>> > + (
>> > + insinto "${directory}"
>>
>> Shouldn't there be checking for errors here, for the case that insinto
>> fails?
> Hmm, I don't even know if insinto should ever fail.
It can fail if the underlying "install -d" fails, e.g. if a regular
file is in the way of the directory to be created.
> And if it does, then the following doins should fail as well, I
> guess.
Normally I also don't add any error checks for insinto in ebuilds.
But for a general eclass function, chances are higher that something
goes wrong. For example, arguments may be specified in the wrong
order. So some extra error checking cannot harm (and is cheap).
On Fri, 17 Aug 2012 18:53:43 +0200
Jeroen Roovers <jer@gentoo.org> wrote:
> On Thu, 16 Aug 2012 22:19:44 +0200
> Michał Górny <mgorny@gentoo.org> wrote:
>
> > ---
> > eutils.eclass | 37 +++++++++++++++++++++++++++++++++++++
> > 1 file changed, 37 insertions(+)
>
> Could you provide a couple of use cases?
Patch 2 does that. It's basically intended to be used in other eclasses
to implement do*() and new*() functions.