public inbox for gentoo-osx@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Christopher Chan" <cchan@spikesource.com>
To: <gentoo-osx@lists.gentoo.org>
Subject: [gentoo-osx] [PREFIX] calling portage within eclass/ebuilds
Date: Fri, 28 Apr 2006 11:45:30 -0700	[thread overview]
Message-ID: <001e01c66af3$ed461c70$491610ac@cardigan> (raw)

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-osx@gentoo.org mailing list



             reply	other threads:[~2006-04-28 18:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-28 18:45 Christopher Chan [this message]
2006-04-28 19:59 ` [gentoo-osx] [PREFIX] calling portage within eclass/ebuilds Grobian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001e01c66af3$ed461c70$491610ac@cardigan' \
    --to=cchan@spikesource.com \
    --cc=gentoo-osx@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox