From: Mark Hatle Date: Tue, 19 Mar 2013 20:28:51 +0000 (-0500) Subject: bitbake: data.py: Add a warning when expandKeys overwrites an existing key X-Git-Tag: rev_ivi_2015_02_04~12956 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80de1a2fcbc6600017260b6eb9f600b2052b907b;p=scm%2Fbb%2Ftizen-distro.git bitbake: data.py: Add a warning when expandKeys overwrites an existing key When two variables are defined as: ${var} = "bar" foo = "foobar" The value of 'foo' when ${var} == foo becomes indeterminate. We want to warn a user when this situation has been encountered so they can take corrective actions. In the above example usually foo == bar, unless multilibs are enabled. Then ml-foo = "ml-foobar". (Bitbake rev: 7c568132c54a21161de28907159f902462f1e2bb) Signed-off-by: Mark Hatle Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 7047f48..110666c 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py @@ -158,6 +158,11 @@ def expandKeys(alterdata, readdata = None): for key in todolist: ekey = todolist[key] + if ekey in keys(alterdata): + val = alterdata.getVar(key, 0) + newval = alterdata.getVar(ekey, 0) + if val is not None and newval is not None: + bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval)) alterdata.renameVar(key, ekey) def inheritFromOS(d, savedenv, permitted):