Re: [OE-core] [PATCH 3/3] utils: add trim_version() function

2013-05-23 Thread Chris Larson
On Thu, May 23, 2013 at 11:45 AM, Ross Burton wrote: > +def trim_version(version, num_parts=2): > +""" > +Return just the first of , split by periods. For > +example, trim_version("1.2.3", 2) will return "1.2". > +""" > +if type(version) is not str: > +raise TypeErro

[OE-core] [PATCH 3/3] utils: add trim_version() function

2013-05-23 Thread Ross Burton
Add a helper function that returns just the first of , split by periods. For example, trim_version("1.2.3", 2) will return "1.2". This should help reduce the spread of numerous copies of this idea across classes and recipes. Signed-off-by: Ross Burton --- meta/lib/oe/tests/test_utils.py | 2