Gentoo Archives: gentoo-portage-dev

From: Ulrich Mueller <ulm@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-portage-dev@l.g.o, Mike Frysinger <vapier@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] ebuild: set up bash compat levels
Date: Sat, 14 Nov 2015 21:00:13
Message-Id: 22087.41170.234660.154274@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-portage-dev] [PATCH] ebuild: set up bash compat levels by "Michał Górny"
1 >>>>> On Fri, 13 Nov 2015, Michał Górny wrote:
2
3 > Ok, I recalled the issue I was particularly concerned about.
4
5 > PV="1_beta2"
6 > MY_PV="${PV/_/~}"
7
8 > This triggers different behavior between bash<=4.2 and bash>=4.3,
9 > with the latter requiring:
10
11 > PV="1_beta2"
12 > MY_PV="${PV/_/\~}"
13
14 > (which in turns breaks older). Now, if someone put a conditional on
15 > BASH_VERSINFO that worked around this discrepancy, introducing
16 > BASH_COMPAT suddenly breaks it by forcing the old behavior when
17 > BASH_VERSINFO indicates the new behavior is expected.
18
19 > Not saying this is very likely to happen.
20
21 Highly unlikely, IMHO. There are several workarounds that are simpler
22 than making the code conditional on the bash version. For example:
23
24 tilde="~"; MY_PV="${PV/_/${tilde}}"
25
26 or:
27
28 MY_PV="${PV/_/$'\x7e'}"
29
30 > However, we are clearly violating the idea behind PMS by allowing it
31 > to happen retroactively.
32
33 Not sure. PMS is (and always was) quite clear about which bash version
34 belongs to which EAPI, so ebuilds have no business of circumventing
35 this by doing their own version checks.
36
37 > However, enabling BASH_COMPAT in EAPI 6 is a good thing. For
38 > example, because people in EAPI 6 no longer need to be concerned
39 > about this discrepancy.
40
41 Enabling it for EAPI 6 only will lead to the paradoxical situation
42 that bash will be compatible to 4.2 in EAPI 6, as it should be.
43 Whereas earlier EAPIs (which should use 3.2 really) will get the
44 behaviour of bash 4.3 or later instead.
45
46 Ulrich