1 |
On 07-01-2008 22:29:46 +0200, Petteri Räty wrote: |
2 |
> Fabian Groffen kirjoitti: |
3 |
>> |
4 |
>> would it be possible to do it like we do it in Portage? |
5 |
>> |
6 |
>> sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path. realpath(__file__))), "pym")) |
7 |
>> |
8 |
> |
9 |
> Or we could just depend on a new enough Portage where just import portage |
10 |
> works. This probably works in prefix too? |
11 |
|
12 |
Well... one can only do "import portage" if one's really sure one uses a |
13 |
Gentoo patched python. (Admittedly this is in general the case.) |
14 |
Portage code itself uses a guard to extend the python path in case the |
15 |
import fails. |
16 |
|
17 |
However, doing "import portage" slows you down a lot, so if you don't |
18 |
really need it, I would disadvice to do it. |
19 |
|
20 |
>> The globs in findclass I guess we'll have to patch in the prefix case, |
21 |
>> though I'm wondering if that doesn't need ROOT support anyway? |
22 |
>> If you'd really want to make be happy you'd do a |
23 |
>> try: |
24 |
>> from portage.const import EPREFIX |
25 |
>> catch ImportError: |
26 |
>> EPREFIX = '' |
27 |
>> |
28 |
>> pkg = glob.glob(EPREFIX + '/usr/share/*/package.env') |
29 |
> |
30 |
> Well you build against the stuff in / so ROOT should not be used I think. |
31 |
|
32 |
I'm not sure how much root support works in Java. I just imagined that |
33 |
you'd run the tool on a chroot or something. |
34 |
|
35 |
|
36 |
-- |
37 |
Fabian Groffen |
38 |
Gentoo on a different level |
39 |
-- |
40 |
gentoo-java@l.g.o mailing list |