Re: javatoolkit: new project layout

Fabian Groffen <[email protected]>
Newsgroups gmane.linux.gentoo.java
Organization Gentoo Foundation, Inc.
Message-ID <[email protected]>
On 07-01-2008 22:29:46 +0200, Petteri Räty wrote:
> Fabian Groffen kirjoitti:
>>
>> would it be possible to do it like we do it in Portage?
>>
>>  sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.  realpath(__file__))), "pym"))
>>
>
> Or we could just depend on a new enough Portage where just import portage 
> works. This probably works in prefix too?

Well... one can only do "import portage" if one's really sure one uses a
Gentoo patched python.  (Admittedly this is in general the case.)
Portage code itself uses a guard to extend the python path in case the
import fails.

However, doing "import portage" slows you down a lot, so if you don't
really need it, I would disadvice to do it.

>> The globs in findclass I guess we'll have to patch in the prefix case,
>> though I'm wondering if that doesn't need ROOT support anyway?
>> If you'd really want to make be happy you'd do a
>>   try:
>>     from portage.const import EPREFIX
>>   catch ImportError:
>>     EPREFIX = ''
>>
>>   pkg = glob.glob(EPREFIX + '/usr/share/*/package.env')
>
> Well you build against the stuff in / so ROOT should not be used I think.

I'm not sure how much root support works in Java.  I just imagined that
you'd run the tool on a chroot or something.


-- 
Fabian Groffen
Gentoo on a different level
-- 
[email protected] mailing list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.