Re: javatoolkit: new project layout
Petteri Räty <[email protected]>
| Newsgroups | gmane.linux.gentoo.java |
|---|---|
| Message-ID | <[email protected]> |
Fabian Groffen kirjoitti: > 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. > Yeah but in chroot you would of course use / Regards, Petteri
signature.asc
(application/pgp-signature, 260 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkeCttAACgkQcxLzpIGCsLQxEQCfaO2s14Y9s7DrH1WD3bFI/7Ii zE8AoI7fLVqFHWdyBxMHEpqyQEGAat1b =XYup -----END PGP SIGNATURE-----