From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-devhelp+bounces-180-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 45FBA1381F3
	for <garchives@archives.gentoo.org>; Thu, 30 May 2013 11:07:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 16007E0950;
	Thu, 30 May 2013 11:07:00 +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 4B207E0950
	for <gentoo-devhelp@lists.gentoo.org>; Thu, 30 May 2013 11:06:58 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id 3F63A33DE10
	for <gentoo-devhelp@lists.gentoo.org>; Thu, 30 May 2013 11:06:58 +0000 (UTC)
X-Virus-Scanned: by amavisd-new using ClamAV at gentoo.org
X-Spam-Flag: NO
X-Spam-Score: -0.19
X-Spam-Level:
X-Spam-Status: No, score=-0.19 tagged_above=-999 required=5.5
	tests=[AWL=-0.320, 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=-1.07, 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 yFcqBdq7i83x for <gentoo-devhelp@lists.gentoo.org>;
	Thu, 30 May 2013 11:06:52 +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 9DB8333DB75
	for <gentoo-devhelp@gentoo.org>; Thu, 30 May 2013 11:06:49 +0000 (UTC)
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <glgd-gentoo-devhelp@m.gmane.org>)
	id 1Ui0gs-0002Wq-Qj
	for gentoo-devhelp@gentoo.org; Thu, 30 May 2013 13:06:42 +0200
Received: from athedsl-347758.home.otenet.gr ([85.72.214.12])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <gentoo-devhelp@gentoo.org>; Thu, 30 May 2013 13:06:42 +0200
Received: from realnc by athedsl-347758.home.otenet.gr with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <gentoo-devhelp@gentoo.org>; Thu, 30 May 2013 13:06:42 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: gentoo-devhelp@lists.gentoo.org
From: Nikos Chantziaras <realnc@gmail.com>
Subject: [gentoo-devhelp] How do I get the major+minor version of a package?
Date: Thu, 30 May 2013 14:06:24 +0300
Organization: Lucas Barks
Message-ID: <ko7bri$iop$1@ger.gmane.org>
Precedence: bulk
List-Post: <mailto:gentoo-devhelp@lists.gentoo.org>
List-Help: <mailto:gentoo-devhelp+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-devhelp+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-devhelp+subscribe@lists.gentoo.org>
List-Id: Gentoo Development-related help <gentoo-devhelp.gentoo.org>
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-347758.home.otenet.gr
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
X-Archives-Salt: cb338700-bfcc-40f5-9807-f954c090af63
X-Archives-Hash: 16dc81551491b8d830afec65a9fc30b2

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.