Gentoo Archives: gentoo-devhelp

From: Justin <jlec@g.o>
To: gentoo-devhelp@l.g.o
Subject: Re: [gentoo-devhelp] How do I get the major+minor version of a package?
Date: Thu, 30 May 2013 11:11:13
Message-Id: 51A733C8.60009@gentoo.org
In Reply to: [gentoo-devhelp] How do I get the major+minor version of a package? by Nikos Chantziaras
1 On 30/05/13 13:06, Nikos Chantziaras wrote:
2 > Let's suppose that $PV is "2.5.1". How would I get the "2.5" in it in an
3 > ebuild? I know about ${PV:0:3}, but this breaks if $PV is, say,
4 > "2.13.1". In that case, I would get "2.1" instead of "2.13".
5 >
6 > I've looked in the various eclasses if there's some utility function
7 > that get me the major and minor version, but can't find anything.
8 >
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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-devhelp] Re: How do I get the major+minor version of a package? Nikos Chantziaras <realnc@×××××.com>