From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8393 invoked from network); 19 Oct 2004 01:08:18 +0000 Received: from smtp.gentoo.org (156.56.111.197) by lists.gentoo.org with AES256-SHA encrypted SMTP; 19 Oct 2004 01:08:18 +0000 Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.41) id 1CJiU5-00018v-Ld for arch-gentoo-portage-dev@lists.gentoo.org; Tue, 19 Oct 2004 01:08:17 +0000 Received: (qmail 19953 invoked by uid 89); 19 Oct 2004 01:08:16 +0000 Mailing-List: contact gentoo-portage-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail Reply-To: gentoo-portage-dev@lists.gentoo.org X-BeenThere: gentoo-portage-dev@gentoo.org Received: (qmail 4982 invoked from network); 19 Oct 2004 01:08:16 +0000 From: Brian To: gentoo-portage-dev@lists.gentoo.org In-Reply-To: <200410182253.44450.jstubbs@gentoo.org> References: <200410172001.37303.jstubbs@gentoo.org> <1098030320.8046.19.camel@localhost> <200410182253.44450.jstubbs@gentoo.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Mon, 18 Oct 2004 18:08:52 -0700 Message-Id: <1098148132.27883.87.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.0 Content-Transfer-Encoding: 8bit Subject: Re: [gentoo-portage-dev] Portage API X-Archives-Salt: 7d492a68-4550-40de-b22a-4447ad3cc1cc X-Archives-Hash: 6f8239bf571850112f13c09ff6bdc7f1 Here is the portion of Fredriks reply on the porthole-dev list for those that are not on that list. Hi, Yes, I confess. I wrote most of portagelib.py. I am a little rusty though, since I haven't been involved in porthole development for quite som time. mån 2004-10-18 klockan 22.14 skrev Brian: > On Mon, 2004-10-18 at 22:53 +0900, Jason Stubbs wrote: > > The current USE settings. I'm don't see why PORTDIR or PORTDIR_OVERLAY is > > needed. > > Porthole searches the directories for ebuilds, etc.. Better to use the > correct directories, so get the correct directories. I believe Dan was > using portage rather than creating new code to scan thru /etc/make.conf > as well as the globals & defaults. Yep, except it was I who did it :-) > > > portage.auxdbkeys > > > > I'm not sure what's required here either. auxdbkeys is/should be a list of all properties an ebuild can have. It was used to get all properties at once. The point of this was, if I recall correctly, to convert the properties into fields in a python object. Not necessary, but high in hack value, I think :-) > > > # showing complete porthole function for (possibly) more clarity > > > def get_properties(ebuild): > > > """Get all ebuild variables in one chunk.""" > > > return Properties(dict(zip(keys, > > > portage.portdb.aux_get(ebuild, > > > portage.auxdbkeys)))) > > > > > > See previous point. > > To use portage's vercmp() I would have to write a python bubble sort to > sort a list of ebuild versions. What I did was use Marius's code and > modified it to pad the version string parts to 3 digits then used > python's builtin list.sort(). > Ah, but list.sort() takes an option argument, which is a comparison function. I haven't looked at it, but I would guess vercmp() is designed to work with list.sort(). No need to write that bubble sort. -- Fredrik Arnerup http://www.stacken.kth.se/~foo/ -- Brian -- gentoo-portage-dev@gentoo.org mailing list