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