From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1FZXyK-0001SU-Sk for garchives@archives.gentoo.org; Fri, 28 Apr 2006 18:45:45 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.6/8.13.6) with SMTP id k3SIjYcG016424; Fri, 28 Apr 2006 18:45:34 GMT Received: from smtp101.sbc.mail.re2.yahoo.com (smtp101.sbc.mail.re2.yahoo.com [68.142.229.104]) by robin.gentoo.org (8.13.6/8.13.6) with SMTP id k3SIjWp7011212 for ; Fri, 28 Apr 2006 18:45:33 GMT Received: (qmail 37481 invoked from network); 28 Apr 2006 18:45:31 -0000 Received: from unknown (HELO cardigan) (chrisbmw@sbcglobal.net@209.10.209.56 with login) by smtp101.sbc.mail.re2.yahoo.com with SMTP; 28 Apr 2006 18:45:31 -0000 From: "Christopher Chan" To: Subject: [gentoo-osx] [PREFIX] calling portage within eclass/ebuilds Date: Fri, 28 Apr 2006 11:45:30 -0700 Message-ID: <001e01c66af3$ed461c70$491610ac@cardigan> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-osx@gentoo.org Reply-to: gentoo-osx@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Thread-Index: AcZq8+yVNHsJt1tjQninv/TRzM1ZXQ== X-Archives-Salt: 30386048-4bfb-4be6-960f-d647e177f9ee X-Archives-Hash: 2c9353645c7c326c6086633bef447ac4 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