Gentoo Archives: gentoo-osx

From: Christopher Chan <cchan@×××××××××××.com>
To: gentoo-osx@l.g.o
Subject: [gentoo-osx] [PREFIX] calling portage within eclass/ebuilds
Date: Fri, 28 Apr 2006 18:45:45
Message-Id: 001e01c66af3$ed461c70$491610ac@cardigan
Hi all,

I've been working to get phpBB (along with webapp.eclass & webapp-config) to
work in prefixed environment.  I've succeeded in getting those things
working and deployed in prefix, but during that process, I discovered
problems with scripts or commands that use portage within an ebuild or

In my case, webapp.eclass uses webapp-config, and it imports portage.  But
portage sets 'root' from ROOT environment variable and we, in turn, append
EPREFIX to it.  This does not work within an eclass or ebuild because ROOT
already has the EPREFIX so webapp-config fails.  I also noticed that
has_version() eventually calls portageq which has the same problem.

Has anyone else ran into this scenario?

In any case, I hacked to reset root to '/' if ROOT = EPREFIX

Looks like this:
if os.environ.has_key("ROOT"):
+    ## cchan - HACK for when portage is being called within an
+       if root == portage_const.EPREFIX: root="/"
        if not len(root):
        elif root[-1]!="/":

Thoughts from others?

BTW, I would be happy to submit my work on webapp.eclass, webapp-config, and
other ebuilds.

gentoo-osx@g.o mailing list