summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-30 13:47:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-02 15:44:10 +0100
commit2d7cf6c056691b6de81bdbb029225d7e0e16f37b (patch)
tree3c3c0abaa8c1e40946b445de659d4fd339d335de /bitbake/lib
parent2abf8a699edd513405befbd1a0eafc8f55d6b514 (diff)
downloadpoky-2d7cf6c056691b6de81bdbb029225d7e0e16f37b.tar.gz
bitbake: doc/lib: Update to use new override syntax containing colons
This runs the overrides conversion script in OE-Core over the bitbake code base including the docs. A handful of things were excluded in toaster and for the Changelog file. (Bitbake rev: 47f8d3b24fd52381bf3b41e2f55a53e57841344c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py2
-rw-r--r--bitbake/lib/bb/tests/data.py52
-rw-r--r--bitbake/lib/bb/tests/parse.py16
-rw-r--r--bitbake/lib/toaster/orm/models.py2
-rw-r--r--bitbake/lib/toaster/toastergui/views.py6
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/buildimport.py2
6 files changed, 40 insertions, 40 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 0d49e1da37..60aaf3902a 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1150,7 +1150,7 @@ def srcrev_internal_helper(ud, d, name):
1150 if name != '': 1150 if name != '':
1151 attempts.append("SRCREV_%s" % name) 1151 attempts.append("SRCREV_%s" % name)
1152 if pn: 1152 if pn:
1153 attempts.append("SRCREV_pn-%s" % pn) 1153 attempts.append("SRCREV:pn-%s" % pn)
1154 attempts.append("SRCREV") 1154 attempts.append("SRCREV")
1155 1155
1156 for a in attempts: 1156 for a in attempts:
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index 1d4a64b109..add1b13600 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -245,35 +245,35 @@ class TestConcatOverride(unittest.TestCase):
245 245
246 def test_prepend(self): 246 def test_prepend(self):
247 self.d.setVar("TEST", "${VAL}") 247 self.d.setVar("TEST", "${VAL}")
248 self.d.setVar("TEST_prepend", "${FOO}:") 248 self.d.setVar("TEST:prepend", "${FOO}:")
249 self.assertEqual(self.d.getVar("TEST"), "foo:val") 249 self.assertEqual(self.d.getVar("TEST"), "foo:val")
250 250
251 def test_append(self): 251 def test_append(self):
252 self.d.setVar("TEST", "${VAL}") 252 self.d.setVar("TEST", "${VAL}")
253 self.d.setVar("TEST_append", ":${BAR}") 253 self.d.setVar("TEST:append", ":${BAR}")
254 self.assertEqual(self.d.getVar("TEST"), "val:bar") 254 self.assertEqual(self.d.getVar("TEST"), "val:bar")
255 255
256 def test_multiple_append(self): 256 def test_multiple_append(self):
257 self.d.setVar("TEST", "${VAL}") 257 self.d.setVar("TEST", "${VAL}")
258 self.d.setVar("TEST_prepend", "${FOO}:") 258 self.d.setVar("TEST:prepend", "${FOO}:")
259 self.d.setVar("TEST_append", ":val2") 259 self.d.setVar("TEST:append", ":val2")
260 self.d.setVar("TEST_append", ":${BAR}") 260 self.d.setVar("TEST:append", ":${BAR}")
261 self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar") 261 self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
262 262
263 def test_append_unset(self): 263 def test_append_unset(self):
264 self.d.setVar("TEST_prepend", "${FOO}:") 264 self.d.setVar("TEST:prepend", "${FOO}:")
265 self.d.setVar("TEST_append", ":val2") 265 self.d.setVar("TEST:append", ":val2")
266 self.d.setVar("TEST_append", ":${BAR}") 266 self.d.setVar("TEST:append", ":${BAR}")
267 self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar") 267 self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar")
268 268
269 def test_remove(self): 269 def test_remove(self):
270 self.d.setVar("TEST", "${VAL} ${BAR}") 270 self.d.setVar("TEST", "${VAL} ${BAR}")
271 self.d.setVar("TEST_remove", "val") 271 self.d.setVar("TEST:remove", "val")
272 self.assertEqual(self.d.getVar("TEST"), " bar") 272 self.assertEqual(self.d.getVar("TEST"), " bar")
273 273
274 def test_remove_cleared(self): 274 def test_remove_cleared(self):
275 self.d.setVar("TEST", "${VAL} ${BAR}") 275 self.d.setVar("TEST", "${VAL} ${BAR}")
276 self.d.setVar("TEST_remove", "val") 276 self.d.setVar("TEST:remove", "val")
277 self.d.setVar("TEST", "${VAL} ${BAR}") 277 self.d.setVar("TEST", "${VAL} ${BAR}")
278 self.assertEqual(self.d.getVar("TEST"), "val bar") 278 self.assertEqual(self.d.getVar("TEST"), "val bar")
279 279
@@ -281,42 +281,42 @@ class TestConcatOverride(unittest.TestCase):
281 # (including that whitespace is preserved) 281 # (including that whitespace is preserved)
282 def test_remove_inactive_override(self): 282 def test_remove_inactive_override(self):
283 self.d.setVar("TEST", "${VAL} ${BAR} 123") 283 self.d.setVar("TEST", "${VAL} ${BAR} 123")
284 self.d.setVar("TEST_remove_inactiveoverride", "val") 284 self.d.setVar("TEST:remove_inactiveoverride", "val")
285 self.assertEqual(self.d.getVar("TEST"), "val bar 123") 285 self.assertEqual(self.d.getVar("TEST"), "val bar 123")
286 286
287 def test_doubleref_remove(self): 287 def test_doubleref_remove(self):
288 self.d.setVar("TEST", "${VAL} ${BAR}") 288 self.d.setVar("TEST", "${VAL} ${BAR}")
289 self.d.setVar("TEST_remove", "val") 289 self.d.setVar("TEST:remove", "val")
290 self.d.setVar("TEST_TEST", "${TEST} ${TEST}") 290 self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
291 self.assertEqual(self.d.getVar("TEST_TEST"), " bar bar") 291 self.assertEqual(self.d.getVar("TEST_TEST"), " bar bar")
292 292
293 def test_empty_remove(self): 293 def test_empty_remove(self):
294 self.d.setVar("TEST", "") 294 self.d.setVar("TEST", "")
295 self.d.setVar("TEST_remove", "val") 295 self.d.setVar("TEST:remove", "val")
296 self.assertEqual(self.d.getVar("TEST"), "") 296 self.assertEqual(self.d.getVar("TEST"), "")
297 297
298 def test_remove_expansion(self): 298 def test_remove_expansion(self):
299 self.d.setVar("BAR", "Z") 299 self.d.setVar("BAR", "Z")
300 self.d.setVar("TEST", "${BAR}/X Y") 300 self.d.setVar("TEST", "${BAR}/X Y")
301 self.d.setVar("TEST_remove", "${BAR}/X") 301 self.d.setVar("TEST:remove", "${BAR}/X")
302 self.assertEqual(self.d.getVar("TEST"), " Y") 302 self.assertEqual(self.d.getVar("TEST"), " Y")
303 303
304 def test_remove_expansion_items(self): 304 def test_remove_expansion_items(self):
305 self.d.setVar("TEST", "A B C D") 305 self.d.setVar("TEST", "A B C D")
306 self.d.setVar("BAR", "B D") 306 self.d.setVar("BAR", "B D")
307 self.d.setVar("TEST_remove", "${BAR}") 307 self.d.setVar("TEST:remove", "${BAR}")
308 self.assertEqual(self.d.getVar("TEST"), "A C ") 308 self.assertEqual(self.d.getVar("TEST"), "A C ")
309 309
310 def test_remove_preserve_whitespace(self): 310 def test_remove_preserve_whitespace(self):
311 # When the removal isn't active, the original value should be preserved 311 # When the removal isn't active, the original value should be preserved
312 self.d.setVar("TEST", " A B") 312 self.d.setVar("TEST", " A B")
313 self.d.setVar("TEST_remove", "C") 313 self.d.setVar("TEST:remove", "C")
314 self.assertEqual(self.d.getVar("TEST"), " A B") 314 self.assertEqual(self.d.getVar("TEST"), " A B")
315 315
316 def test_remove_preserve_whitespace2(self): 316 def test_remove_preserve_whitespace2(self):
317 # When the removal is active preserve the whitespace 317 # When the removal is active preserve the whitespace
318 self.d.setVar("TEST", " A B") 318 self.d.setVar("TEST", " A B")
319 self.d.setVar("TEST_remove", "B") 319 self.d.setVar("TEST:remove", "B")
320 self.assertEqual(self.d.getVar("TEST"), " A ") 320 self.assertEqual(self.d.getVar("TEST"), " A ")
321 321
322class TestOverrides(unittest.TestCase): 322class TestOverrides(unittest.TestCase):
@@ -362,10 +362,10 @@ class TestOverrides(unittest.TestCase):
362 self.assertEqual(self.d.getVar("TEST"), "testvalue3") 362 self.assertEqual(self.d.getVar("TEST"), "testvalue3")
363 363
364 def test_rename_override(self): 364 def test_rename_override(self):
365 self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a") 365 self.d.setVar("ALTERNATIVE:ncurses-tools:class-target", "a")
366 self.d.setVar("OVERRIDES", "class-target") 366 self.d.setVar("OVERRIDES", "class-target")
367 self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools") 367 self.d.renameVar("ALTERNATIVE:ncurses-tools", "ALTERNATIVE:lib32-ncurses-tools")
368 self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a") 368 self.assertEqual(self.d.getVar("ALTERNATIVE:lib32-ncurses-tools"), "a")
369 369
370 def test_underscore_override(self): 370 def test_underscore_override(self):
371 self.d.setVar("TEST_bar", "testvalue2") 371 self.d.setVar("TEST_bar", "testvalue2")
@@ -377,22 +377,22 @@ class TestOverrides(unittest.TestCase):
377 def test_remove_with_override(self): 377 def test_remove_with_override(self):
378 self.d.setVar("TEST_bar", "testvalue2") 378 self.d.setVar("TEST_bar", "testvalue2")
379 self.d.setVar("TEST_some_val", "testvalue3 testvalue5") 379 self.d.setVar("TEST_some_val", "testvalue3 testvalue5")
380 self.d.setVar("TEST_some_val_remove", "testvalue3") 380 self.d.setVar("TEST_some_val:remove", "testvalue3")
381 self.d.setVar("TEST_foo", "testvalue4") 381 self.d.setVar("TEST_foo", "testvalue4")
382 self.d.setVar("OVERRIDES", "foo:bar:some_val") 382 self.d.setVar("OVERRIDES", "foo:bar:some_val")
383 self.assertEqual(self.d.getVar("TEST"), " testvalue5") 383 self.assertEqual(self.d.getVar("TEST"), " testvalue5")
384 384
385 def test_append_and_override_1(self): 385 def test_append_and_override_1(self):
386 self.d.setVar("TEST_append", "testvalue2") 386 self.d.setVar("TEST:append", "testvalue2")
387 self.d.setVar("TEST_bar", "testvalue3") 387 self.d.setVar("TEST_bar", "testvalue3")
388 self.assertEqual(self.d.getVar("TEST"), "testvalue3testvalue2") 388 self.assertEqual(self.d.getVar("TEST"), "testvalue3testvalue2")
389 389
390 def test_append_and_override_2(self): 390 def test_append_and_override_2(self):
391 self.d.setVar("TEST_append_bar", "testvalue2") 391 self.d.setVar("TEST:append_bar", "testvalue2")
392 self.assertEqual(self.d.getVar("TEST"), "testvaluetestvalue2") 392 self.assertEqual(self.d.getVar("TEST"), "testvaluetestvalue2")
393 393
394 def test_append_and_override_3(self): 394 def test_append_and_override_3(self):
395 self.d.setVar("TEST_bar_append", "testvalue2") 395 self.d.setVar("TEST_bar:append", "testvalue2")
396 self.assertEqual(self.d.getVar("TEST"), "testvalue2") 396 self.assertEqual(self.d.getVar("TEST"), "testvalue2")
397 397
398 # Test an override with _<numeric> in it based on a real world OE issue 398 # Test an override with _<numeric> in it based on a real world OE issue
@@ -400,7 +400,7 @@ class TestOverrides(unittest.TestCase):
400 self.d.setVar("TARGET_ARCH", "x86_64") 400 self.d.setVar("TARGET_ARCH", "x86_64")
401 self.d.setVar("PN", "test-${TARGET_ARCH}") 401 self.d.setVar("PN", "test-${TARGET_ARCH}")
402 self.d.setVar("VERSION", "1") 402 self.d.setVar("VERSION", "1")
403 self.d.setVar("VERSION_pn-test-${TARGET_ARCH}", "2") 403 self.d.setVar("VERSION:pn-test-${TARGET_ARCH}", "2")
404 self.d.setVar("OVERRIDES", "pn-${PN}") 404 self.d.setVar("OVERRIDES", "pn-${PN}")
405 bb.data.expandKeys(self.d) 405 bb.data.expandKeys(self.d)
406 self.assertEqual(self.d.getVar("VERSION"), "2") 406 self.assertEqual(self.d.getVar("VERSION"), "2")
@@ -498,7 +498,7 @@ class TaskHash(unittest.TestCase):
498 d.setVar("VAR", "val") 498 d.setVar("VAR", "val")
499 # Adding an inactive removal shouldn't change the hash 499 # Adding an inactive removal shouldn't change the hash
500 d.setVar("BAR", "notbar") 500 d.setVar("BAR", "notbar")
501 d.setVar("MYCOMMAND_remove", "${BAR}") 501 d.setVar("MYCOMMAND:remove", "${BAR}")
502 nexthash = gettask_bashhash("mytask", d) 502 nexthash = gettask_bashhash("mytask", d)
503 self.assertEqual(orighash, nexthash) 503 self.assertEqual(orighash, nexthash)
504 504
diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index 9e21e18425..02a5c4952a 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/lib/bb/tests/parse.py
@@ -98,8 +98,8 @@ exportD = "d"
98 98
99 99
100 overridetest = """ 100 overridetest = """
101RRECOMMENDS_${PN} = "a" 101RRECOMMENDS:${PN} = "a"
102RRECOMMENDS_${PN}_libc = "b" 102RRECOMMENDS:${PN}_libc = "b"
103OVERRIDES = "libc:${PN}" 103OVERRIDES = "libc:${PN}"
104PN = "gtk+" 104PN = "gtk+"
105""" 105"""
@@ -110,13 +110,13 @@ PN = "gtk+"
110 self.assertEqual(d.getVar("RRECOMMENDS"), "b") 110 self.assertEqual(d.getVar("RRECOMMENDS"), "b")
111 bb.data.expandKeys(d) 111 bb.data.expandKeys(d)
112 self.assertEqual(d.getVar("RRECOMMENDS"), "b") 112 self.assertEqual(d.getVar("RRECOMMENDS"), "b")
113 d.setVar("RRECOMMENDS_gtk+", "c") 113 d.setVar("RRECOMMENDS:gtk+", "c")
114 self.assertEqual(d.getVar("RRECOMMENDS"), "c") 114 self.assertEqual(d.getVar("RRECOMMENDS"), "c")
115 115
116 overridetest2 = """ 116 overridetest2 = """
117EXTRA_OECONF = "" 117EXTRA_OECONF = ""
118EXTRA_OECONF_class-target = "b" 118EXTRA_OECONF:class-target = "b"
119EXTRA_OECONF_append = " c" 119EXTRA_OECONF:append = " c"
120""" 120"""
121 121
122 def test_parse_overrides(self): 122 def test_parse_overrides(self):
@@ -128,7 +128,7 @@ EXTRA_OECONF_append = " c"
128 128
129 overridetest3 = """ 129 overridetest3 = """
130DESCRIPTION = "A" 130DESCRIPTION = "A"
131DESCRIPTION_${PN}-dev = "${DESCRIPTION} B" 131DESCRIPTION:${PN}-dev = "${DESCRIPTION} B"
132PN = "bc" 132PN = "bc"
133""" 133"""
134 134
@@ -136,9 +136,9 @@ PN = "bc"
136 f = self.parsehelper(self.overridetest3) 136 f = self.parsehelper(self.overridetest3)
137 d = bb.parse.handle(f.name, self.d)[''] 137 d = bb.parse.handle(f.name, self.d)['']
138 bb.data.expandKeys(d) 138 bb.data.expandKeys(d)
139 self.assertEqual(d.getVar("DESCRIPTION_bc-dev"), "A B") 139 self.assertEqual(d.getVar("DESCRIPTION:bc-dev"), "A B")
140 d.setVar("DESCRIPTION", "E") 140 d.setVar("DESCRIPTION", "E")
141 d.setVar("DESCRIPTION_bc-dev", "C D") 141 d.setVar("DESCRIPTION:bc-dev", "C D")
142 d.setVar("OVERRIDES", "bc-dev") 142 d.setVar("OVERRIDES", "bc-dev")
143 self.assertEqual(d.getVar("DESCRIPTION"), "C D") 143 self.assertEqual(d.getVar("DESCRIPTION"), "C D")
144 144
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 7f7e922ade..4c94b407d7 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1719,7 +1719,7 @@ class CustomImageRecipe(Recipe):
1719 """Generate the contents for the recipe file.""" 1719 """Generate the contents for the recipe file."""
1720 # If we have no excluded packages we only need to _append 1720 # If we have no excluded packages we only need to _append
1721 if self.excludes_set.count() == 0: 1721 if self.excludes_set.count() == 0:
1722 packages_conf = "IMAGE_INSTALL_append = \" " 1722 packages_conf = "IMAGE_INSTALL:append = \" "
1723 1723
1724 for pkg in self.appends_set.all(): 1724 for pkg in self.appends_set.all():
1725 packages_conf += pkg.name+' ' 1725 packages_conf += pkg.name+' '
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 9a5e48e3bb..04ab8bcb04 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1708,7 +1708,7 @@ if True:
1708 except ProjectVariable.DoesNotExist: 1708 except ProjectVariable.DoesNotExist:
1709 pass 1709 pass
1710 try: 1710 try:
1711 return_data['image_install_append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value, 1711 return_data['image_install:append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL:append").value,
1712 except ProjectVariable.DoesNotExist: 1712 except ProjectVariable.DoesNotExist:
1713 pass 1713 pass
1714 try: 1714 try:
@@ -1839,8 +1839,8 @@ if True:
1839 except ProjectVariable.DoesNotExist: 1839 except ProjectVariable.DoesNotExist:
1840 pass 1840 pass
1841 try: 1841 try:
1842 context['image_install_append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value 1842 context['image_install:append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL:append").value
1843 context['image_install_append_defined'] = "1" 1843 context['image_install:append_defined'] = "1"
1844 except ProjectVariable.DoesNotExist: 1844 except ProjectVariable.DoesNotExist:
1845 pass 1845 pass
1846 try: 1846 try:
diff --git a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
index 59da6ff7ac..e25b55e5ab 100644
--- a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
+++ b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
@@ -451,7 +451,7 @@ class Command(BaseCommand):
451 # Catch vars relevant to Toaster (in case no Toaster section) 451 # Catch vars relevant to Toaster (in case no Toaster section)
452 self.update_project_vars(project,'DISTRO') 452 self.update_project_vars(project,'DISTRO')
453 self.update_project_vars(project,'MACHINE') 453 self.update_project_vars(project,'MACHINE')
454 self.update_project_vars(project,'IMAGE_INSTALL_append') 454 self.update_project_vars(project,'IMAGE_INSTALL:append')
455 self.update_project_vars(project,'IMAGE_FSTYPES') 455 self.update_project_vars(project,'IMAGE_FSTYPES')
456 self.update_project_vars(project,'PACKAGE_CLASSES') 456 self.update_project_vars(project,'PACKAGE_CLASSES')
457 # These vars are typically only assigned by Toaster 457 # These vars are typically only assigned by Toaster