public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] meaning of EROOT
@ 2013-02-03 11:07 heroxbd
  2013-02-03 20:56 ` Zac Medico
  2013-02-04 11:01 ` Michael Weber
  0 siblings, 2 replies; 4+ messages in thread
From: heroxbd @ 2013-02-03 11:07 UTC (permalink / raw
  To: gentoo-dev

Dear All,

I am a bit confused with the meaning of EROOT.

In a usual Prefix installation, ROOT=/ and EPREFIX=/opt/gentoo,
EROOT=/opt/gentoo/.

Naturally, EROOT=${EPREFIX}${ROOT}, right?

But for example in ./python.eclass

    EROOT="${ROOT%/}${EPREFIX}/"

and in LocationsManager.py of portage

    self.eroot = self.target_root.rstrip(os.sep) + self.eprefix + os.sep

What is the logic behind this construction?

The problem rises when I want to cross-compile under Prefix. Taking
armv7a-hardfloat-linux-gnueabi for example,
ROOT=/usr/armv7a-hardfloat-linux-gnueabi/, EPREFIX=/opt/gentoo. I'd
expect EROOT to be ${EPREFIX}${ROOT}, therefore,
/opt/gentoo/usr/armv7a-hardfloat-linux-gnueabi/. At present
EROOT=/usr/armv7a-hardfloat-linux-gnueabi/opt/gentoo/, which is
completely useless.

Cheers,
Benda


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] meaning of EROOT
  2013-02-03 11:07 [gentoo-dev] meaning of EROOT heroxbd
@ 2013-02-03 20:56 ` Zac Medico
  2013-02-04 11:01 ` Michael Weber
  1 sibling, 0 replies; 4+ messages in thread
From: Zac Medico @ 2013-02-03 20:56 UTC (permalink / raw
  To: gentoo-dev

On 02/03/2013 03:07 AM, heroxbd wrote:
> Dear All,
> 
> I am a bit confused with the meaning of EROOT.
> 
> In a usual Prefix installation, ROOT=/ and EPREFIX=/opt/gentoo,
> EROOT=/opt/gentoo/.
> 
> Naturally, EROOT=${EPREFIX}${ROOT}, right?

No, it's EROOT=${ROOT%/}${EPREFIX}/

> But for example in ./python.eclass
> 
>     EROOT="${ROOT%/}${EPREFIX}/"
> 
> and in LocationsManager.py of portage
> 
>     self.eroot = self.target_root.rstrip(os.sep) + self.eprefix + os.sep
> 
> What is the logic behind this construction?

ROOT corresponds to a valid chroot point. EPREFIX is an offset inside a
valid chroot point.

> The problem rises when I want to cross-compile under Prefix. Taking
> armv7a-hardfloat-linux-gnueabi for example,
> ROOT=/usr/armv7a-hardfloat-linux-gnueabi/, EPREFIX=/opt/gentoo. I'd
> expect EROOT to be ${EPREFIX}${ROOT}, therefore,
> /opt/gentoo/usr/armv7a-hardfloat-linux-gnueabi/. At present
> EROOT=/usr/armv7a-hardfloat-linux-gnueabi/opt/gentoo/, which is
> completely useless.

You've filed this bug on the same topic:

  https://bugs.gentoo.org/show_bug.cgi?id=395633

We should continue there.
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] meaning of EROOT
  2013-02-03 11:07 [gentoo-dev] meaning of EROOT heroxbd
  2013-02-03 20:56 ` Zac Medico
@ 2013-02-04 11:01 ` Michael Weber
  2013-02-04 16:07   ` Zac Medico
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Weber @ 2013-02-04 11:01 UTC (permalink / raw
  To: gentoo-dev

On 02/03/2013 12:07 PM, heroxbd wrote:
>     self.eroot = self.target_root.rstrip(os.sep) + self.eprefix + os.sep
wouldn't be this more robust

>>> import os
>>> os.path.normpath('/some/' + os.path.sep + '/stuff/') + os.path.sep
'/some/stuff/'


-- 
Michael Weber
Gentoo Developer
web: https://xmw.de/
mailto: Michael Weber <xmw@gentoo.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] meaning of EROOT
  2013-02-04 11:01 ` Michael Weber
@ 2013-02-04 16:07   ` Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2013-02-04 16:07 UTC (permalink / raw
  To: gentoo-dev

On 02/04/2013 03:01 AM, Michael Weber wrote:
> On 02/03/2013 12:07 PM, heroxbd wrote:
>>     self.eroot = self.target_root.rstrip(os.sep) + self.eprefix + os.sep
> wouldn't be this more robust
> 
>>>> import os
>>>> os.path.normpath('/some/' + os.path.sep + '/stuff/') + os.path.sep
> '/some/stuff/'

In this context, the relevant paths have already been normalized earlier.
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-04 16:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-03 11:07 [gentoo-dev] meaning of EROOT heroxbd
2013-02-03 20:56 ` Zac Medico
2013-02-04 11:01 ` Michael Weber
2013-02-04 16:07   ` Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox