]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa.buildperf: another fix for splitting 'nevr' string
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 8 Sep 2016 16:47:46 +0000 (19:47 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 13 Sep 2016 14:18:42 +0000 (15:18 +0100)
When processing buildstats we determine recipe name, epoch, version and
revision from the per-recipe buildstat directory name.  One previous
patch made an assumption that package version starts with a number.
That might not be true because of a packaging mistake or whatever
reason. Thus, if a version starting with a number is not found, fall
back to the "old" method of just taking the second-last dash-delimited
part (the one before revision).

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 9700c059251cdc3cb3428e4c63f5051a728e5731..2c102554b9fd5d358277588ba089e47388b6e050 100644 (file)
@@ -428,6 +428,11 @@ class BuildPerfTestCase(unittest.TestCase):
             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)
+            if not match:
+                # If we're not able to parse a version starting with a number, just
+                # take the part after last dash
+                match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[^-]+)$',
+                                 n_e_v)
             name = match.group('name')
             version = match.group('version')
             epoch = match.group('epoch')