From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24905 invoked from network); 17 Oct 2004 16:24:53 +0000 Received: from smtp.gentoo.org (156.56.111.197) by lists.gentoo.org with AES256-SHA encrypted SMTP; 17 Oct 2004 16:24:53 +0000 Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.41) id 1CJDq0-00081D-PN for arch-gentoo-portage-dev@lists.gentoo.org; Sun, 17 Oct 2004 16:24:52 +0000 Received: (qmail 628 invoked by uid 89); 17 Oct 2004 16:24:51 +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 10281 invoked from network); 17 Oct 2004 16:24:50 +0000 From: Brian To: gentoo-portage-dev@lists.gentoo.org In-Reply-To: <200410172001.37303.jstubbs@gentoo.org> References: <200410172001.37303.jstubbs@gentoo.org> Content-Type: text/plain Date: Sun, 17 Oct 2004 09:25:20 -0700 Message-Id: <1098030320.8046.19.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.0 Content-Transfer-Encoding: 7bit Subject: Re: [gentoo-portage-dev] Portage API X-Archives-Salt: e4eae131-4a63-4e1c-936c-8f3e1ad2c222 X-Archives-Hash: 99bc3469723e577dd2116cfcc207c09f On Sun, 2004-10-17 at 20:01 +0900, Jason Stubbs wrote: > So, let the suggestions roll. :) > > Regards, > Jason Stubbs Dan has been the porthole developer that has done the most integrating portage modules for porthole's use, but it looks like we are loosing him from gentoo for now. I have not had much reason to think about how much more we might need from portage. Portage modules/variables currently used directly by Porthole: portage.grabfile():: used for obtaining [keywords.desc, use.desc, use.local.desc] portage.config(clone=portage.settings).environ()[var] :: where var = 1 of ['PORTDIR_OVERLAY','PORTDIR', "USE"] portage.auxdbkeys """Extract installed versions from full name.""" return portage.db['/']['vartree'].dep_match(full_name) portage.db['/']['porttree'].getallnodes() portage.db['/']['vartree'].getallnodes() portage.catpkgsplit(ebuild) portage.portdb.aux_get(ebuild, [property])[0] portage.best(versions) # 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)))) def get_versions(self, include_masked = True): """Returns all versions of the available ebuild""" # Note: this slow, especially when include_masked is false criterion = include_masked and 'match-all' or 'match-visible' return portage.portdb.xmatch(criterion, self.full_name) Wish list: Portages version comparison/handling code from bug: http://bugs.gentoo.org/show_bug.cgi?id=37406 was would be implemented soon. I see browsing thru 2.0.51_rc9 that it is not yet implemented. If it is being implemented Porthole should use the following from portage's code: ver_regexp = re.compile("^(cvs-)?(\\d+)((\\.\\d+)*)([a-zA-Z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?$") suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") # modified portage comparison suffix values for sorting in desired precedence suffix_value = {"alpha": '0', "beta": '1', "pre": '2', "rc": '3', "p": '4'} That would allow porthole's modified version of that code to follow any changes in portage's values. -- Brian -- gentoo-portage-dev@gentoo.org mailing list