summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-09 17:17:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-15 20:08:15 -0800
commitf0d5eb39c3ec939d4d42796ab53490d08c7609a5 (patch)
treebc9dcd8301649106cb1f3123da62b8aed00d445b /bitbake/lib
parent01b9ab89dea3b8ab9781b7d06e5024106ced1dd0 (diff)
downloadpoky-f0d5eb39c3ec939d4d42796ab53490d08c7609a5.tar.gz
bitbake: lib: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls so we can just remove them. They're not actually done anything at all for a while. (Bitbake rev: 2300beb50333bb620013b058a7309e7f2042101d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/cooker.py3
-rw-r--r--bitbake/lib/bb/data_smart.py1
-rw-r--r--bitbake/lib/bb/parse/ast.py3
-rw-r--r--bitbake/lib/bb/providers.py1
-rw-r--r--bitbake/lib/bb/tests/data.py18
5 files changed, 1 insertions, 25 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 80007c53de..74607f7192 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -642,7 +642,6 @@ class BBCooker:
642 logger.plain(env.getvalue()) 642 logger.plain(env.getvalue())
643 643
644 # emit variables and shell functions 644 # emit variables and shell functions
645 data.update_data(envdata)
646 with closing(StringIO()) as env: 645 with closing(StringIO()) as env:
647 data.emit_env(env, envdata, True) 646 data.emit_env(env, envdata, True)
648 logger.plain(env.getvalue()) 647 logger.plain(env.getvalue())
@@ -703,7 +702,6 @@ class BBCooker:
703 for mc in self.multiconfigs: 702 for mc in self.multiconfigs:
704 taskdata[mc] = bb.taskdata.TaskData(abort, skiplist=self.skiplist, allowincomplete=allowincomplete) 703 taskdata[mc] = bb.taskdata.TaskData(abort, skiplist=self.skiplist, allowincomplete=allowincomplete)
705 localdata[mc] = data.createCopy(self.databuilder.mcdata[mc]) 704 localdata[mc] = data.createCopy(self.databuilder.mcdata[mc])
706 bb.data.update_data(localdata[mc])
707 bb.data.expandKeys(localdata[mc]) 705 bb.data.expandKeys(localdata[mc])
708 706
709 current = 0 707 current = 0
@@ -1035,7 +1033,6 @@ class BBCooker:
1035 1033
1036 for mc in self.multiconfigs: 1034 for mc in self.multiconfigs:
1037 localdata = data.createCopy(self.databuilder.mcdata[mc]) 1035 localdata = data.createCopy(self.databuilder.mcdata[mc])
1038 bb.data.update_data(localdata)
1039 bb.data.expandKeys(localdata) 1036 bb.data.expandKeys(localdata)
1040 1037
1041 # Handle PREFERRED_PROVIDERS 1038 # Handle PREFERRED_PROVIDERS
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 0cd41683d9..4d56081b66 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -976,7 +976,6 @@ class DataSmart(MutableMapping):
976 data = {} 976 data = {}
977 d = self.createCopy() 977 d = self.createCopy()
978 bb.data.expandKeys(d) 978 bb.data.expandKeys(d)
979 bb.data.update_data(d)
980 979
981 config_whitelist = set((d.getVar("BB_HASHCONFIG_WHITELIST") or "").split()) 980 config_whitelist = set((d.getVar("BB_HASHCONFIG_WHITELIST") or "").split())
982 keys = set(key for key in iter(d) if not key.startswith("__")) 981 keys = set(key for key in iter(d) if not key.startswith("__"))
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 8b5b36619d..dba4540f5e 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -130,7 +130,6 @@ class DataNode(AstNode):
130 val = groupd["value"] 130 val = groupd["value"]
131 elif "colon" in groupd and groupd["colon"] != None: 131 elif "colon" in groupd and groupd["colon"] != None:
132 e = data.createCopy() 132 e = data.createCopy()
133 bb.data.update_data(e)
134 op = "immediate" 133 op = "immediate"
135 val = e.expand(groupd["value"], key + "[:=]") 134 val = e.expand(groupd["value"], key + "[:=]")
136 elif "append" in groupd and groupd["append"] != None: 135 elif "append" in groupd and groupd["append"] != None:
@@ -350,12 +349,10 @@ def finalize(fn, d, variant = None):
350 bb.event.fire(bb.event.RecipePreFinalise(fn), d) 349 bb.event.fire(bb.event.RecipePreFinalise(fn), d)
351 350
352 bb.data.expandKeys(d) 351 bb.data.expandKeys(d)
353 bb.data.update_data(d)
354 code = [] 352 code = []
355 for funcname in d.getVar("__BBANONFUNCS", False) or []: 353 for funcname in d.getVar("__BBANONFUNCS", False) or []:
356 code.append("%s(d)" % funcname) 354 code.append("%s(d)" % funcname)
357 bb.utils.better_exec("\n".join(code), {"d": d}) 355 bb.utils.better_exec("\n".join(code), {"d": d})
358 bb.data.update_data(d)
359 356
360 tasklist = d.getVar('__BBTASKS', False) or [] 357 tasklist = d.getVar('__BBTASKS', False) or []
361 bb.event.fire(bb.event.RecipeTaskPreProcess(fn, list(tasklist)), d) 358 bb.event.fire(bb.event.RecipeTaskPreProcess(fn, list(tasklist)), d)
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py
index 0e9c8344d2..443187e17f 100644
--- a/bitbake/lib/bb/providers.py
+++ b/bitbake/lib/bb/providers.py
@@ -48,7 +48,6 @@ def findProviders(cfgData, dataCache, pkg_pn = None):
48 48
49 # Need to ensure data store is expanded 49 # Need to ensure data store is expanded
50 localdata = data.createCopy(cfgData) 50 localdata = data.createCopy(cfgData)
51 bb.data.update_data(localdata)
52 bb.data.expandKeys(localdata) 51 bb.data.expandKeys(localdata)
53 52
54 preferred_versions = {} 53 preferred_versions = {}
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index 0903ba7cc3..be46ffc31b 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -258,13 +258,11 @@ class TestConcatOverride(unittest.TestCase):
258 def test_prepend(self): 258 def test_prepend(self):
259 self.d.setVar("TEST", "${VAL}") 259 self.d.setVar("TEST", "${VAL}")
260 self.d.setVar("TEST_prepend", "${FOO}:") 260 self.d.setVar("TEST_prepend", "${FOO}:")
261 bb.data.update_data(self.d)
262 self.assertEqual(self.d.getVar("TEST"), "foo:val") 261 self.assertEqual(self.d.getVar("TEST"), "foo:val")
263 262
264 def test_append(self): 263 def test_append(self):
265 self.d.setVar("TEST", "${VAL}") 264 self.d.setVar("TEST", "${VAL}")
266 self.d.setVar("TEST_append", ":${BAR}") 265 self.d.setVar("TEST_append", ":${BAR}")
267 bb.data.update_data(self.d)
268 self.assertEqual(self.d.getVar("TEST"), "val:bar") 266 self.assertEqual(self.d.getVar("TEST"), "val:bar")
269 267
270 def test_multiple_append(self): 268 def test_multiple_append(self):
@@ -272,47 +270,40 @@ class TestConcatOverride(unittest.TestCase):
272 self.d.setVar("TEST_prepend", "${FOO}:") 270 self.d.setVar("TEST_prepend", "${FOO}:")
273 self.d.setVar("TEST_append", ":val2") 271 self.d.setVar("TEST_append", ":val2")
274 self.d.setVar("TEST_append", ":${BAR}") 272 self.d.setVar("TEST_append", ":${BAR}")
275 bb.data.update_data(self.d)
276 self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar") 273 self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
277 274
278 def test_append_unset(self): 275 def test_append_unset(self):
279 self.d.setVar("TEST_prepend", "${FOO}:") 276 self.d.setVar("TEST_prepend", "${FOO}:")
280 self.d.setVar("TEST_append", ":val2") 277 self.d.setVar("TEST_append", ":val2")
281 self.d.setVar("TEST_append", ":${BAR}") 278 self.d.setVar("TEST_append", ":${BAR}")
282 bb.data.update_data(self.d)
283 self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar") 279 self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar")
284 280
285 def test_remove(self): 281 def test_remove(self):
286 self.d.setVar("TEST", "${VAL} ${BAR}") 282 self.d.setVar("TEST", "${VAL} ${BAR}")
287 self.d.setVar("TEST_remove", "val") 283 self.d.setVar("TEST_remove", "val")
288 bb.data.update_data(self.d)
289 self.assertEqual(self.d.getVar("TEST"), "bar") 284 self.assertEqual(self.d.getVar("TEST"), "bar")
290 285
291 def test_doubleref_remove(self): 286 def test_doubleref_remove(self):
292 self.d.setVar("TEST", "${VAL} ${BAR}") 287 self.d.setVar("TEST", "${VAL} ${BAR}")
293 self.d.setVar("TEST_remove", "val") 288 self.d.setVar("TEST_remove", "val")
294 self.d.setVar("TEST_TEST", "${TEST} ${TEST}") 289 self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
295 bb.data.update_data(self.d)
296 self.assertEqual(self.d.getVar("TEST_TEST"), "bar bar") 290 self.assertEqual(self.d.getVar("TEST_TEST"), "bar bar")
297 291
298 def test_empty_remove(self): 292 def test_empty_remove(self):
299 self.d.setVar("TEST", "") 293 self.d.setVar("TEST", "")
300 self.d.setVar("TEST_remove", "val") 294 self.d.setVar("TEST_remove", "val")
301 bb.data.update_data(self.d)
302 self.assertEqual(self.d.getVar("TEST"), "") 295 self.assertEqual(self.d.getVar("TEST"), "")
303 296
304 def test_remove_expansion(self): 297 def test_remove_expansion(self):
305 self.d.setVar("BAR", "Z") 298 self.d.setVar("BAR", "Z")
306 self.d.setVar("TEST", "${BAR}/X Y") 299 self.d.setVar("TEST", "${BAR}/X Y")
307 self.d.setVar("TEST_remove", "${BAR}/X") 300 self.d.setVar("TEST_remove", "${BAR}/X")
308 bb.data.update_data(self.d)
309 self.assertEqual(self.d.getVar("TEST"), "Y") 301 self.assertEqual(self.d.getVar("TEST"), "Y")
310 302
311 def test_remove_expansion_items(self): 303 def test_remove_expansion_items(self):
312 self.d.setVar("TEST", "A B C D") 304 self.d.setVar("TEST", "A B C D")
313 self.d.setVar("BAR", "B D") 305 self.d.setVar("BAR", "B D")
314 self.d.setVar("TEST_remove", "${BAR}") 306 self.d.setVar("TEST_remove", "${BAR}")
315 bb.data.update_data(self.d)
316 self.assertEqual(self.d.getVar("TEST"), "A C") 307 self.assertEqual(self.d.getVar("TEST"), "A C")
317 308
318class TestOverrides(unittest.TestCase): 309class TestOverrides(unittest.TestCase):
@@ -322,17 +313,15 @@ class TestOverrides(unittest.TestCase):
322 self.d.setVar("TEST", "testvalue") 313 self.d.setVar("TEST", "testvalue")
323 314
324 def test_no_override(self): 315 def test_no_override(self):
325 bb.data.update_data(self.d)
326 self.assertEqual(self.d.getVar("TEST"), "testvalue") 316 self.assertEqual(self.d.getVar("TEST"), "testvalue")
327 317
328 def test_one_override(self): 318 def test_one_override(self):
329 self.d.setVar("TEST_bar", "testvalue2") 319 self.d.setVar("TEST_bar", "testvalue2")
330 bb.data.update_data(self.d)
331 self.assertEqual(self.d.getVar("TEST"), "testvalue2") 320 self.assertEqual(self.d.getVar("TEST"), "testvalue2")
332 321
333 def test_one_override_unset(self): 322 def test_one_override_unset(self):
334 self.d.setVar("TEST2_bar", "testvalue2") 323 self.d.setVar("TEST2_bar", "testvalue2")
335 bb.data.update_data(self.d) 324
336 self.assertEqual(self.d.getVar("TEST2"), "testvalue2") 325 self.assertEqual(self.d.getVar("TEST2"), "testvalue2")
337 self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST2', 'OVERRIDES', 'TEST2_bar']) 326 self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST2', 'OVERRIDES', 'TEST2_bar'])
338 327
@@ -340,18 +329,15 @@ class TestOverrides(unittest.TestCase):
340 self.d.setVar("TEST_bar", "testvalue2") 329 self.d.setVar("TEST_bar", "testvalue2")
341 self.d.setVar("TEST_local", "testvalue3") 330 self.d.setVar("TEST_local", "testvalue3")
342 self.d.setVar("TEST_foo", "testvalue4") 331 self.d.setVar("TEST_foo", "testvalue4")
343 bb.data.update_data(self.d)
344 self.assertEqual(self.d.getVar("TEST"), "testvalue3") 332 self.assertEqual(self.d.getVar("TEST"), "testvalue3")
345 self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST_foo', 'OVERRIDES', 'TEST_bar', 'TEST_local']) 333 self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST_foo', 'OVERRIDES', 'TEST_bar', 'TEST_local'])
346 334
347 def test_multiple_combined_overrides(self): 335 def test_multiple_combined_overrides(self):
348 self.d.setVar("TEST_local_foo_bar", "testvalue3") 336 self.d.setVar("TEST_local_foo_bar", "testvalue3")
349 bb.data.update_data(self.d)
350 self.assertEqual(self.d.getVar("TEST"), "testvalue3") 337 self.assertEqual(self.d.getVar("TEST"), "testvalue3")
351 338
352 def test_multiple_overrides_unset(self): 339 def test_multiple_overrides_unset(self):
353 self.d.setVar("TEST2_local_foo_bar", "testvalue3") 340 self.d.setVar("TEST2_local_foo_bar", "testvalue3")
354 bb.data.update_data(self.d)
355 self.assertEqual(self.d.getVar("TEST2"), "testvalue3") 341 self.assertEqual(self.d.getVar("TEST2"), "testvalue3")
356 342
357 def test_keyexpansion_override(self): 343 def test_keyexpansion_override(self):
@@ -359,14 +345,12 @@ class TestOverrides(unittest.TestCase):
359 self.d.setVar("TEST_bar", "testvalue2") 345 self.d.setVar("TEST_bar", "testvalue2")
360 self.d.setVar("TEST_${LOCAL}", "testvalue3") 346 self.d.setVar("TEST_${LOCAL}", "testvalue3")
361 self.d.setVar("TEST_foo", "testvalue4") 347 self.d.setVar("TEST_foo", "testvalue4")
362 bb.data.update_data(self.d)
363 bb.data.expandKeys(self.d) 348 bb.data.expandKeys(self.d)
364 self.assertEqual(self.d.getVar("TEST"), "testvalue3") 349 self.assertEqual(self.d.getVar("TEST"), "testvalue3")
365 350
366 def test_rename_override(self): 351 def test_rename_override(self):
367 self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a") 352 self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a")
368 self.d.setVar("OVERRIDES", "class-target") 353 self.d.setVar("OVERRIDES", "class-target")
369 bb.data.update_data(self.d)
370 self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools") 354 self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools")
371 self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a") 355 self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a")
372 356