Gentoo Archives: gentoo-dev

From: "Gregory M. Turner" <gmt@×××××.us>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] relative ROOT: correct behavior when ROOT=
Date: Thu, 06 Sep 2012 09:35:57
Message-Id: 50486E36.7010102@malth.us
In Reply to: Re: [gentoo-dev] relative ROOT: correct behavior when ROOT= by Ulrich Mueller
1 On 9/6/2012 12:55 AM, Ulrich Mueller wrote:
2 >>>>>> On Thu, 06 Sep 2012, Gregory M Turner wrote:
3 >> Several correct-ish solutions exist, i.e., in the above we could change
4 >> the concatenation statement to read:
5 >
6 >> EROOT="${ROOT}${EPREFIX#/}"
7 >
8 > I'd rather do it the other way around:
9 > EROOT=${ROOT%/}${EPREFIX}
10 >
11 > Reason: EPREFIX is guaranteed to start with a slash, whereas for ROOT
12 > I wouldn't be so sure that it always ends with one.
13
14 Good point, but EPREFIX is empty for non-prefix gentoo. So, I guess:
15
16 EROOT="${ROOT%/}/${EPREFIX#/}"
17
18 It's a contrived example anyhow, so it's mostly academic.
19
20 My main concern is the correct behavior when ROOT is defined, but empty
21 -- I mostly included this explanation to preempt anyone inclined to ask
22 "what are you trying to achieve?" :P
23
24 -gmt