From 32391e968a2679982e6c716b04059917ab6c8285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Tue, 22 Sep 2015 18:35:38 -0500 Subject: [PATCH] rrs_upstream_history.py: Fix use regexes in packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make difference when handling suffixes or preffixes like 'nativesdk-' when try to use regexes in packages that have suffixes like '-crosssdk' it can contain the arch into it like binutils-crosssdk-x86_64. Use split method in suffixes and replace method into preffixes, this fixes issues with suffixes containing archs at end. [YOCTO #8102] Signed-off-by: Aníbal Limón --- rrs/tools/rrs_upstream_history.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/rrs/tools/rrs_upstream_history.py b/rrs/tools/rrs_upstream_history.py index aeac3d3..3db8f38 100755 --- a/rrs/tools/rrs_upstream_history.py +++ b/rrs/tools/rrs_upstream_history.py @@ -54,14 +54,20 @@ def set_regexes(d): return suffixes = d.getVar('SPECIAL_PKGSUFFIX', True).split() - suffixes.append('nativesdk-') + prefixes = ['nativesdk-'] + + special = list(suffixes) + special.extend(prefixes) localdata = bb.data.createCopy(d) - pn = localdata.getVar('PN', True) - for sfx in suffixes: - if pn.find(sfx) != -1: - pnstripped = pn.replace(sfx, '') + for s in special: + if pn.find(s) != -1: + if s in suffixes: + pnstripped = pn.split(s)[0] + else: + pnstripped = pn.replace(s, '') + localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True)) bb.data.update_data(localdata)