diff options
author | Ross Burton <ross.burton@intel.com> | 2016-11-16 17:22:05 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-30 15:48:10 +0000 |
commit | 9e63f81c78e284c9b325fe04a1b59e61c7ad8a1a (patch) | |
tree | 6721fb09daa803d0e1b12a36be081ca9c20b0267 /bitbake/lib | |
parent | caf1a69577b10bbb0e7914964e2ef4bb69c18def (diff) | |
download | poky-9e63f81c78e284c9b325fe04a1b59e61c7ad8a1a.tar.gz |
bitbake: ast: remove BBVERSIONS support
BBVERSIONS is moderately horrible and it doesn't appear to be actually used by
anyone, so remove it to simplify the finalise codepaths.
(Bitbake rev: 0bb188f01e396052b127e170a25246d79a6d6741)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 7020940df9..853dda86b4 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -30,8 +30,6 @@ import itertools | |||
30 | from bb import methodpool | 30 | from bb import methodpool |
31 | from bb.parse import logger | 31 | from bb.parse import logger |
32 | 32 | ||
33 | _bbversions_re = re.compile(r"\[(?P<from>[0-9]+)-(?P<to>[0-9]+)\]") | ||
34 | |||
35 | class StatementGroup(list): | 33 | class StatementGroup(list): |
36 | def eval(self, data): | 34 | def eval(self, data): |
37 | for statement in self: | 35 | for statement in self: |
@@ -385,27 +383,6 @@ def _create_variants(datastores, names, function, onlyfinalise): | |||
385 | else: | 383 | else: |
386 | create_variant("%s-%s" % (variant, name), datastores[variant], name) | 384 | create_variant("%s-%s" % (variant, name), datastores[variant], name) |
387 | 385 | ||
388 | def _expand_versions(versions): | ||
389 | def expand_one(version, start, end): | ||
390 | for i in range(start, end + 1): | ||
391 | ver = _bbversions_re.sub(str(i), version, 1) | ||
392 | yield ver | ||
393 | |||
394 | versions = iter(versions) | ||
395 | while True: | ||
396 | try: | ||
397 | version = next(versions) | ||
398 | except StopIteration: | ||
399 | break | ||
400 | |||
401 | range_ver = _bbversions_re.search(version) | ||
402 | if not range_ver: | ||
403 | yield version | ||
404 | else: | ||
405 | newversions = expand_one(version, int(range_ver.group("from")), | ||
406 | int(range_ver.group("to"))) | ||
407 | versions = itertools.chain(newversions, versions) | ||
408 | |||
409 | def multi_finalize(fn, d): | 386 | def multi_finalize(fn, d): |
410 | appends = (d.getVar("__BBAPPEND") or "").split() | 387 | appends = (d.getVar("__BBAPPEND") or "").split() |
411 | for append in appends: | 388 | for append in appends: |
@@ -422,50 +399,6 @@ def multi_finalize(fn, d): | |||
422 | d.setVar("__SKIPPED", e.args[0]) | 399 | d.setVar("__SKIPPED", e.args[0]) |
423 | datastores = {"": safe_d} | 400 | datastores = {"": safe_d} |
424 | 401 | ||
425 | versions = (d.getVar("BBVERSIONS") or "").split() | ||
426 | if versions: | ||
427 | pv = orig_pv = d.getVar("PV") | ||
428 | baseversions = {} | ||
429 | |||
430 | def verfunc(ver, d, pv_d = None): | ||
431 | if pv_d is None: | ||
432 | pv_d = d | ||
433 | |||
434 | overrides = d.getVar("OVERRIDES").split(":") | ||
435 | pv_d.setVar("PV", ver) | ||
436 | overrides.append(ver) | ||
437 | bpv = baseversions.get(ver) or orig_pv | ||
438 | pv_d.setVar("BPV", bpv) | ||
439 | overrides.append(bpv) | ||
440 | d.setVar("OVERRIDES", ":".join(overrides)) | ||
441 | |||
442 | versions = list(_expand_versions(versions)) | ||
443 | for pos, version in enumerate(list(versions)): | ||
444 | try: | ||
445 | pv, bpv = version.split(":", 2) | ||
446 | except ValueError: | ||
447 | pass | ||
448 | else: | ||
449 | versions[pos] = pv | ||
450 | baseversions[pv] = bpv | ||
451 | |||
452 | if pv in versions and not baseversions.get(pv): | ||
453 | versions.remove(pv) | ||
454 | else: | ||
455 | pv = versions.pop() | ||
456 | |||
457 | # This is necessary because our existing main datastore | ||
458 | # has already been finalized with the old PV, we need one | ||
459 | # that's been finalized with the new PV. | ||
460 | d = bb.data.createCopy(safe_d) | ||
461 | verfunc(pv, d, safe_d) | ||
462 | try: | ||
463 | finalize(fn, d) | ||
464 | except bb.parse.SkipRecipe as e: | ||
465 | d.setVar("__SKIPPED", e.args[0]) | ||
466 | |||
467 | _create_variants(datastores, versions, verfunc, onlyfinalise) | ||
468 | |||
469 | extended = d.getVar("BBCLASSEXTEND") or "" | 402 | extended = d.getVar("BBCLASSEXTEND") or "" |
470 | if extended: | 403 | if extended: |
471 | # the following is to support bbextends with arguments, for e.g. multilib | 404 | # the following is to support bbextends with arguments, for e.g. multilib |