Gentoo Archives: gentoo-devhelp

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-devhelp@l.g.o
Subject: [gentoo-devhelp] Re: How do I get the major+minor version of a package?
Date: Fri, 07 Jun 2013 05:03:49
Message-Id: korpip$1pn$1@ger.gmane.org
In Reply to: Re: [gentoo-devhelp] How do I get the major+minor version of a package? by Justin
1 On 30/05/13 14:11, Justin wrote:
2 > On 30/05/13 13:06, Nikos Chantziaras wrote:
3 >> Let's suppose that $PV is "2.5.1". How would I get the "2.5" in it in an
4 >> ebuild? I know about ${PV:0:3}, but this breaks if $PV is, say,
5 >> "2.13.1". In that case, I would get "2.1" instead of "2.13".
6 >>
7 >> I've looked in the various eclasses if there's some utility function
8 >> that get me the major and minor version, but can't find anything.
9 >>
10 >
11 > hi,
12 >
13 > take a look into the versionator.eclass [1]. You need to use
14 > get_version_component_range()
15 >
16 > justin
17 >
18 >
19 > 1 http://devmanual.gentoo.org/eclass-reference/versionator.eclass/index.html
20
21 Yep, does the just perfectly. Thanks!