From d974ed4330f33c4f8dfd635a83c61a0d44e688b6 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 13 Feb 2012 18:14:18 +0000 Subject: buildhistory_analysis: correctly split RDEPENDS/RRECOMMENDS Split RDEPENDS and RRECOMMENDS correctly (which may contain version number specifications after each item). Signed-off-by: Paul Eggleton --- meta/lib/oe/buildhistory_analysis.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py index bef6cd413..4f3e6359c 100644 --- a/meta/lib/oe/buildhistory_analysis.py +++ b/meta/lib/oe/buildhistory_analysis.py @@ -12,6 +12,7 @@ import sys import os.path import difflib import git +import re # How to display fields @@ -53,9 +54,18 @@ class ChangeRecord: else: prefix = '' + def pkglist_split(pkgs): + pkgit = re.finditer(r'[a-zA-Z0-9.+-]+( \([><=]+ [^ )]+\))?', pkgs, 0) + pkglist = [p.group(0) for p in pkgit] + return pkglist + if self.fieldname in list_fields or self.fieldname in list_order_fields: - aitems = self.oldvalue.split() - bitems = self.newvalue.split() + if self.fieldname in ['RDEPENDS', 'RRECOMMENDS']: + aitems = pkglist_split(self.oldvalue) + bitems = pkglist_split(self.newvalue) + else: + aitems = self.oldvalue.split() + bitems = self.newvalue.split() removed = list(set(aitems) - set(bitems)) added = list(set(bitems) - set(aitems)) if removed or added: -- cgit v1.2.3