Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH eutils 1/2] Add dointo && newinto.
Date: Thu, 16 Aug 2012 22:04:02
Message-Id: 20525.28153.884566.328556@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] [PATCH eutils 1/2] Add dointo && newinto. by "Michał Górny"
1 >>>>> On Thu, 16 Aug 2012, Micha³ Górny wrote:
2
3 >> > +dointo() {
4 >> > + [[ ${#} -gt 2 ]] || die 'Synopsis: dointo <directory>
5 >> > <file> [...]' +
6 >> > + local directory=${1}
7 >> > + shift
8 >> > +
9 >> > + (
10 >> > + insinto "${directory}"
11 >>
12 >> Shouldn't there be checking for errors here, for the case that insinto
13 >> fails?
14
15 > Hmm, I don't even know if insinto should ever fail.
16
17 It can fail if the underlying "install -d" fails, e.g. if a regular
18 file is in the way of the directory to be created.
19
20 > And if it does, then the following doins should fail as well, I
21 > guess.
22
23 Normally I also don't add any error checks for insinto in ebuilds.
24 But for a general eclass function, chances are higher that something
25 goes wrong. For example, arguments may be specified in the wrong
26 order. So some extra error checking cannot harm (and is cheap).
27
28 Ulrich

Replies

Subject Author
[gentoo-dev] [PATCH eutils] Add dointo && newinto. "Michał Górny" <mgorny@g.o>