aboutsummaryrefslogtreecommitdiffstats
path: root/rrs/tools/rrs_upstream_history.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-08-10 14:33:32 -0500
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:52 +1200
commitd1d108507c6825824e0931e088b1f4b2480612e6 (patch)
tree40264fe5cbea819ecf901f1ff9f67a12660eeaff /rrs/tools/rrs_upstream_history.py
parente325f317aa8bc657f7f513bbae210767b59b1cf7 (diff)
downloadopenembedded-core-contrib-d1d108507c6825824e0931e088b1f4b2480612e6.tar.gz
rrs_upstream_history.py: Use regexes in SPECIAL_PKGSUFFIX packages
When SPECIAL_PKGSUFFIX packages don't have regexes use it from package without SPECIAL_PKGSUFFIX. [YOCTO #8102] For example: python-native use regex from python if don't have one. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'rrs/tools/rrs_upstream_history.py')
-rwxr-xr-xrrs/tools/rrs_upstream_history.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/rrs/tools/rrs_upstream_history.py b/rrs/tools/rrs_upstream_history.py
index 521b733cdf..aeac3d39eb 100755
--- a/rrs/tools/rrs_upstream_history.py
+++ b/rrs/tools/rrs_upstream_history.py
@@ -39,6 +39,43 @@ sys.path.insert(0, os.path.join(bitbakepath, 'lib'))
from layerindex.models import Recipe, LayerBranch
from rrs.models import RecipeUpstream, RecipeUpstreamHistory
+def set_regexes(d):
+ """
+ Utility function to set regexes to SPECIAL_PKGSUFFIX packages
+ that don't have set it.
+
+ For example: python-native use regex from python if don't have
+ one set it.
+ """
+
+ variables = ['REGEX', 'REGEX_URI', 'GITTAGREGEX']
+
+ if any(d.getVar(var, True) for var in variables):
+ return
+
+ suffixes = d.getVar('SPECIAL_PKGSUFFIX', True).split()
+ suffixes.append('nativesdk-')
+
+ localdata = bb.data.createCopy(d)
+
+ pn = localdata.getVar('PN', True)
+ for sfx in suffixes:
+ if pn.find(sfx) != -1:
+ pnstripped = pn.replace(sfx, '')
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" +
+ d.getVar('OVERRIDES', True))
+ bb.data.update_data(localdata)
+
+ for var in variables:
+ new_value = localdata.getVar(var, True)
+ if new_value is None:
+ continue
+
+ d.setVar(var, new_value)
+ logger.debug("%s: %s new value %s" % (pn, var,
+ d.getVar(var, True)))
+ break
+
def get_upstream_info(thread_worker, arg):
from bb.utils import vercmp_string
from oe.recipeutils import get_recipe_upstream_version, \
@@ -122,6 +159,9 @@ if __name__=="__main__":
if not recipes:
continue
+ for recipe_data in recipes:
+ set_regexes(recipe_data)
+
history = RecipeUpstreamHistory(start_date = datetime.now())
from oe.utils import ThreadedPool