From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 16C321381F3 for ; Fri, 7 Jun 2013 05:03:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CFDC6E09B4; Fri, 7 Jun 2013 05:03:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F346BE09B4 for ; Fri, 7 Jun 2013 05:03:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 40B6633E4F8 for ; Fri, 7 Jun 2013 05:03:45 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV at gentoo.org X-Spam-Flag: NO X-Spam-Score: 0.046 X-Spam-Level: X-Spam-Status: No, score=0.046 tagged_above=-999 required=5.5 tests=[AWL=-0.620, DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.534, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=no Received: from smtp.gentoo.org ([IPv6:::ffff:127.0.0.1]) by localhost (smtp.gentoo.org [IPv6:::ffff:127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bkB3MYTke3ma for ; Fri, 7 Jun 2013 05:03:39 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7700233E4F7 for ; Fri, 7 Jun 2013 05:03:39 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ukopt-0002oP-GZ for gentoo-devhelp@gentoo.org; Fri, 07 Jun 2013 07:03:37 +0200 Received: from athedsl-348291.home.otenet.gr ([85.72.216.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Jun 2013 07:03:37 +0200 Received: from realnc by athedsl-348291.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Jun 2013 07:03:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-devhelp@lists.gentoo.org From: Nikos Chantziaras Subject: [gentoo-devhelp] Re: How do I get the major+minor version of a package? Date: Fri, 07 Jun 2013 08:03:14 +0300 Organization: Lucas Barks Message-ID: References: <51A733C8.60009@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Development-related help X-BeenThere: gentoo-devhelp@gentoo.org X-BeenThere: gentoo-devhelp@lists.gentoo.org Reply-To: gentoo-devhelp@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: athedsl-348291.home.otenet.gr User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: <51A733C8.60009@gentoo.org> X-Archives-Salt: a9acfcdc-ca0b-4560-8a88-d37e3cba021b X-Archives-Hash: 2ac6eec7337ebd7370676e8ed5295000 On 30/05/13 14:11, Justin wrote: > On 30/05/13 13:06, Nikos Chantziaras wrote: >> Let's suppose that $PV is "2.5.1". How would I get the "2.5" in it in an >> ebuild? I know about ${PV:0:3}, but this breaks if $PV is, say, >> "2.13.1". In that case, I would get "2.1" instead of "2.13". >> >> I've looked in the various eclasses if there's some utility function >> that get me the major and minor version, but can't find anything. >> > > hi, > > take a look into the versionator.eclass [1]. You need to use > get_version_component_range() > > justin > > > 1 http://devmanual.gentoo.org/eclass-reference/versionator.eclass/index.html Yep, does the just perfectly. Thanks!