Skip to contentSkip to conversation

oeqa.buildperf: another fix for splitting 'nevr' string

PATCH New Markus Lehtonen 1 participant 1 message Sep 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa.buildperf: another fix for splitting 'nevr' string

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).

---
 meta/lib/oeqa/buildperf/base.py | 5 +++++
 1 file changed, 5 insertions(+)
meta/lib/oeqa/buildperf/base.py +5 -0
index 9700c05..2c10255 100644
@@ -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')
Signature · 1 line
2.6.6