From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JByo0-0008K0-Vp for garchives@archives.gentoo.org; Mon, 07 Jan 2008 20:42:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B7B28E061F; Mon, 7 Jan 2008 20:42:04 +0000 (UTC) Received: from osiris.cheops.ods.org (osiris.cheops.ods.org [82.95.138.191]) by pigeon.gentoo.org (Postfix) with ESMTP id 916F0E061F for ; Mon, 7 Jan 2008 20:42:04 +0000 (UTC) Received: from tefnut.cheops.ods.org ([2001:888:1022:0:211:24ff:fe37:e46e] helo=gentoo.org) by osiris.cheops.ods.org with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1JBynM-0006SF-0a for gentoo-java@lists.gentoo.org; Mon, 07 Jan 2008 21:42:04 +0100 Date: Mon, 7 Jan 2008 21:42:04 +0100 From: Fabian Groffen To: gentoo-java@lists.gentoo.org Subject: Re: [gentoo-java] javatoolkit: new project layout Message-ID: <20080107204204.GG21604@gentoo.org> Mail-Followup-To: gentoo-java@lists.gentoo.org References: <477F7510.7020505@gentoo.org> <20080105123126.GG7944@gentoo.org> <477FF6B9.6020708@gmail.com> <20080107201921.GF21604@gentoo.org> <47828BBA.7070800@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-java@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <47828BBA.7070800@gentoo.org> User-Agent: Mutt/1.5.17 (Darwin 8.11.0, VIM - Vi IMproved 7.1) Organization: Gentoo Foundation, Inc. Content-Transfer-Encoding: quoted-printable X-Archives-Salt: bed84cb1-6d23-4296-916c-8115fd7caed9 X-Archives-Hash: 7cdd57cde4317c82e69e72c9364ced8e On 07-01-2008 22:29:46 +0200, Petteri R=C3=A4ty 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.pa= th. realpath(__file__))), "pym")) >> > > Or we could just depend on a new enough Portage where just import porta= ge=20 > 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 =3D '' >> >> pkg =3D glob.glob(EPREFIX + '/usr/share/*/package.env') > > Well you build against the stuff in / so ROOT should not be used I thin= k. 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. --=20 Fabian Groffen Gentoo on a different level --=20 gentoo-java@lists.gentoo.org mailing list