public inbox for gentoo-devhelp@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-devhelp] How do I get the major+minor version of a package?
@ 2013-05-30 11:06 Nikos Chantziaras
  2013-05-30 11:11 ` Justin
  0 siblings, 1 reply; 3+ messages in thread
From: Nikos Chantziaras @ 2013-05-30 11:06 UTC (permalink / raw
  To: gentoo-devhelp

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.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-devhelp] How do I get the major+minor version of a package?
  2013-05-30 11:06 [gentoo-devhelp] How do I get the major+minor version of a package? Nikos Chantziaras
@ 2013-05-30 11:11 ` Justin
  2013-06-07  5:03   ` [gentoo-devhelp] " Nikos Chantziaras
  0 siblings, 1 reply; 3+ messages in thread
From: Justin @ 2013-05-30 11:11 UTC (permalink / raw
  To: gentoo-devhelp

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-devhelp] Re: How do I get the major+minor version of a package?
  2013-05-30 11:11 ` Justin
@ 2013-06-07  5:03   ` Nikos Chantziaras
  0 siblings, 0 replies; 3+ messages in thread
From: Nikos Chantziaras @ 2013-06-07  5:03 UTC (permalink / raw
  To: gentoo-devhelp

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!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-07  5:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-30 11:06 [gentoo-devhelp] How do I get the major+minor version of a package? Nikos Chantziaras
2013-05-30 11:11 ` Justin
2013-06-07  5:03   ` [gentoo-devhelp] " Nikos Chantziaras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox