Gentoo Archives: gentoo-devhelp

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-devhelp@l.g.o
Subject: [gentoo-devhelp] How do I get the major+minor version of a package?
Date: Thu, 30 May 2013 11:07:04
Message-Id: ko7bri$iop$1@ger.gmane.org
1 Let's suppose that $PV is "2.5.1". How would I get the "2.5" in it in an
2 ebuild? I know about ${PV:0:3}, but this breaks if $PV is, say,
3 "2.13.1". In that case, I would get "2.1" instead of "2.13".
4
5 I've looked in the various eclasses if there's some utility function
6 that get me the major and minor version, but can't find anything.

Replies