From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7725 invoked from network); 25 Sep 2004 20:36:13 +0000 Received: from smtp.gentoo.org (156.56.111.197) by lists.gentoo.org with AES256-SHA encrypted SMTP; 25 Sep 2004 20:36:13 +0000 Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.41) id 1CBJHA-0000i1-Rj for arch-gentoo-dev@lists.gentoo.org; Sat, 25 Sep 2004 20:36:12 +0000 Received: (qmail 16311 invoked by uid 89); 25 Sep 2004 20:36:12 +0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 2217 invoked from network); 25 Sep 2004 20:36:12 +0000 Date: Sat, 25 Sep 2004 16:36:01 -0400 From: Jon Portnoy To: Abraham Marin Perez Cc: gentoo-dev@lists.gentoo.org Message-ID: <20040925203601.GA21746@cerberus.oppresses.us> References: <1096144355.13217.12.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1096144355.13217.12.camel@localhost> User-Agent: Mutt/1.5.6i Subject: Re: [gentoo-dev] Using some of the emerge features in external programs X-Archives-Salt: 544de301-7627-4513-a9e1-6b2fe036787c X-Archives-Hash: b3bf1ed6e9d26e48e7bb4b467b2dc002 On Sat, Sep 25, 2004 at 10:32:36PM +0200, Abraham Marin Perez wrote: > Hi everyone, > > Firstly I want to say hello since this is the first e-mail I send to > this mailing list. The second and maybe the most important point is that > I'd like to use one of the features of emerge, and that is a way to know > the version of an application that'd be emerged given the name of the > application or, yet better, the complete name(s) of the file(s) that'd > be downloaded to emerge that application. You can access Portage's python library. For example, from the master repository distfiles cleaning script (no idea if it's still in use or not, I'm not involved with distfiles infrastructure anymore): URI=`python -c 'import portage; print portage.db["/"]["porttree"].dbapi.aux_get('\"$CATPKG\"',["SRC_URI"])[0]'` grabbed the Portage-parsed SRC_URI for foo-bar/xyz in $CATPKG. You can then use basename or whatever your preferred method is for parsing out the filenames. -- Jon Portnoy avenj/irc.freenode.net -- gentoo-dev@gentoo.org mailing list