Gentoo Archives: gentoo-pms

From: Ulrich Mueller <ulm@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: Ulrich Mueller <ulm@g.o>, gentoo-pms@l.g.o
Subject: Re: [gentoo-pms] Re: [PATCH] Explain eapply behavior for EAPI 6
Date: Wed, 14 Oct 2015 18:52:38
Message-Id: 22046.42094.324231.885249@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-pms] Re: [PATCH] Explain eapply behavior for EAPI 6 by "Michał Górny"
1 >>>>> On Wed, 14 Oct 2015, Michał Górny wrote:
2
3 >> IF first parameter begins with a hyphen AND any parameter is equal to --
4
5 > Hmm, that's not exactly correct. All parameters preceding -- would have
6 > to begin with a hyphen. So maybe...
7
8 > IF any parameter is equal to -- AND all parameters preceding it
9 > being with a hyphen
10
11 Well, there could be option arguments, too. And we don't know which
12 patch options can have arguments, unless we copy the option parsing
13 from patch(1) which is not feasible.
14
15 My wording was like this on purpose, and the idea is that if the
16 ebuild author has specified an explicit -- separator, then we assume
17 the he knows what he is doing. So we pass the whole part before the --
18 as options (plus possibly option arguments) to patch.
19
20 >> collect all parameters before the first -- in the options array
21 >> collect all parameters after the first -- in the files array
22 >> ELSIF any parameter beginning with a hyphen follows one without a hyphen
23 >> return an error
24
25 > Not sure if we should really specify error handling here. The idea is
26 > that this is incorrect syntax, so it is unconditional fatal error.
27
28 Sure, s/return an error/abort the build process/
29
30 >> ELSE
31 >> collect all parameters starting with a hyphen in the options array
32 >> collect all parameters without a hyphen in the files array
33 >> ENDIF
34
35 >> patch -p1 -f -g0 --no-backup-if-mismatch
36
37 > Ok.
38
39 Good. :)
40
41 >> We should say something about error handling. For example, does the
42 >> function return when it encounters the first error of a called
43 >> patch(1)?
44
45 > Where should I say it? Put in the algorithm?
46
47 Not sure, error exits tend to be clumsy. Does the algorithmic package
48 include a GOTO statement? :) To be serious, maybe it's best to leave
49 it out of the algorithm for better clarity, and put it into the
50 description instead.
51
52 What about nonfatal, BTW? We should be consistent with other commands
53 there.
54
55 Ulrich

Replies

Subject Author
Re: [gentoo-pms] Re: [PATCH] Explain eapply behavior for EAPI 6 "Michał Górny" <mgorny@g.o>