]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa.buildperf: try harder when splitting 'nevr' string
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 7 Sep 2016 07:28:45 +0000 (10:28 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 7 Sep 2016 23:31:40 +0000 (00:31 +0100)
Try to be more intelligent when splitting out recipe name, epoch,
version and revision from the buildstat directory name. Previous
assumption was that package versions never contain a dash but obviously
that is not necessarily true. The new assumption is that the package
version starts with a number.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/buildperf/base.py

index 2325cd1d6be1516799dfb0f1d18cd11fbece045e..7dfb2bff374ce1fad03e1bb2b062187f4d5b90ed 100644 (file)
@@ -425,8 +425,10 @@ class BuildPerfTestCase(unittest.TestCase):
         """Save buildstats"""
         def split_nevr(nevr):
             """Split name and version information from recipe "nevr" string"""
-            name, e_v, revision = nevr.rsplit('-', 2)
-            match = re.match(r'^((?P<epoch>[0-9]{1,5})_)?(?P<version>.*)$', e_v)
+            n_e_v, revision = nevr.rsplit('-', 1)
+            match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[0-9]\S*)$',
+                             n_e_v)
+            name = match.group('name')
             version = match.group('version')
             epoch = match.group('epoch')
             return name, epoch, version, revision