List Info

Thread: calling portage within eclass/ebuilds




calling portage within eclass/ebuilds
user name
2006-04-28 18:45:30
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
eclass.

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 portage.py to reset root to '/' if
ROOT = EPREFIX

Looks like this:
if os.environ.has_key("ROOT"):
        root=os.environ["ROOT"]
+
+    ## cchan - HACK for when portage is being called within
an
ebuild/eclass
+       if root == portage_const.EPREFIX:
root="/"
+        
        if not len(root):
                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-osxgentoo.org mailing list

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )