diff options
Diffstat (limited to 'meta/lib/oe/utils.py')
-rw-r--r-- | meta/lib/oe/utils.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 2b095f1f0a..bb3f0e5d75 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
@@ -23,13 +23,13 @@ def ifelse(condition, iftrue = True, iffalse = False): | |||
23 | return iffalse | 23 | return iffalse |
24 | 24 | ||
25 | def conditional(variable, checkvalue, truevalue, falsevalue, d): | 25 | def conditional(variable, checkvalue, truevalue, falsevalue, d): |
26 | if d.getVar(variable, True) == checkvalue: | 26 | if d.getVar(variable) == checkvalue: |
27 | return truevalue | 27 | return truevalue |
28 | else: | 28 | else: |
29 | return falsevalue | 29 | return falsevalue |
30 | 30 | ||
31 | def less_or_equal(variable, checkvalue, truevalue, falsevalue, d): | 31 | def less_or_equal(variable, checkvalue, truevalue, falsevalue, d): |
32 | if float(d.getVar(variable, True)) <= float(checkvalue): | 32 | if float(d.getVar(variable)) <= float(checkvalue): |
33 | return truevalue | 33 | return truevalue |
34 | else: | 34 | else: |
35 | return falsevalue | 35 | return falsevalue |
@@ -42,8 +42,8 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d): | |||
42 | return falsevalue | 42 | return falsevalue |
43 | 43 | ||
44 | def both_contain(variable1, variable2, checkvalue, d): | 44 | def both_contain(variable1, variable2, checkvalue, d): |
45 | val1 = d.getVar(variable1, True) | 45 | val1 = d.getVar(variable1) |
46 | val2 = d.getVar(variable2, True) | 46 | val2 = d.getVar(variable2) |
47 | val1 = set(val1.split()) | 47 | val1 = set(val1.split()) |
48 | val2 = set(val2.split()) | 48 | val2 = set(val2.split()) |
49 | if isinstance(checkvalue, str): | 49 | if isinstance(checkvalue, str): |
@@ -66,8 +66,8 @@ def set_intersect(variable1, variable2, d): | |||
66 | s3 = set_intersect(s1, s2) | 66 | s3 = set_intersect(s1, s2) |
67 | => s3 = "b c" | 67 | => s3 = "b c" |
68 | """ | 68 | """ |
69 | val1 = set(d.getVar(variable1, True).split()) | 69 | val1 = set(d.getVar(variable1).split()) |
70 | val2 = set(d.getVar(variable2, True).split()) | 70 | val2 = set(d.getVar(variable2).split()) |
71 | return " ".join(val1 & val2) | 71 | return " ".join(val1 & val2) |
72 | 72 | ||
73 | def prune_suffix(var, suffixes, d): | 73 | def prune_suffix(var, suffixes, d): |
@@ -77,7 +77,7 @@ def prune_suffix(var, suffixes, d): | |||
77 | if var.endswith(suffix): | 77 | if var.endswith(suffix): |
78 | var = var.replace(suffix, "") | 78 | var = var.replace(suffix, "") |
79 | 79 | ||
80 | prefix = d.getVar("MLPREFIX", True) | 80 | prefix = d.getVar("MLPREFIX") |
81 | if prefix and var.startswith(prefix): | 81 | if prefix and var.startswith(prefix): |
82 | var = var.replace(prefix, "") | 82 | var = var.replace(prefix, "") |
83 | 83 | ||
@@ -115,9 +115,9 @@ def features_backfill(var,d): | |||
115 | # disturbing distributions that have already set DISTRO_FEATURES. | 115 | # disturbing distributions that have already set DISTRO_FEATURES. |
116 | # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should | 116 | # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should |
117 | # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED | 117 | # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED |
118 | features = (d.getVar(var, True) or "").split() | 118 | features = (d.getVar(var) or "").split() |
119 | backfill = (d.getVar(var+"_BACKFILL", True) or "").split() | 119 | backfill = (d.getVar(var+"_BACKFILL") or "").split() |
120 | considered = (d.getVar(var+"_BACKFILL_CONSIDERED", True) or "").split() | 120 | considered = (d.getVar(var+"_BACKFILL_CONSIDERED") or "").split() |
121 | 121 | ||
122 | addfeatures = [] | 122 | addfeatures = [] |
123 | for feature in backfill: | 123 | for feature in backfill: |
@@ -133,12 +133,12 @@ def packages_filter_out_system(d): | |||
133 | Return a list of packages from PACKAGES with the "system" packages such as | 133 | Return a list of packages from PACKAGES with the "system" packages such as |
134 | PN-dbg PN-doc PN-locale-eb-gb removed. | 134 | PN-dbg PN-doc PN-locale-eb-gb removed. |
135 | """ | 135 | """ |
136 | pn = d.getVar('PN', True) | 136 | pn = d.getVar('PN') |
137 | blacklist = [pn + suffix for suffix in ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev')] | 137 | blacklist = [pn + suffix for suffix in ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev')] |
138 | localepkg = pn + "-locale-" | 138 | localepkg = pn + "-locale-" |
139 | pkgs = [] | 139 | pkgs = [] |
140 | 140 | ||
141 | for pkg in d.getVar('PACKAGES', True).split(): | 141 | for pkg in d.getVar('PACKAGES').split(): |
142 | if pkg not in blacklist and localepkg not in pkg: | 142 | if pkg not in blacklist and localepkg not in pkg: |
143 | pkgs.append(pkg) | 143 | pkgs.append(pkg) |
144 | return pkgs | 144 | return pkgs |
@@ -231,7 +231,7 @@ def format_pkg_list(pkg_dict, ret_format=None): | |||
231 | return '\n'.join(output) | 231 | return '\n'.join(output) |
232 | 232 | ||
233 | def host_gcc_version(d): | 233 | def host_gcc_version(d): |
234 | compiler = d.getVar("BUILD_CC", True) | 234 | compiler = d.getVar("BUILD_CC") |
235 | retval, output = getstatusoutput("%s --version" % compiler) | 235 | retval, output = getstatusoutput("%s --version" % compiler) |
236 | if retval: | 236 | if retval: |
237 | bb.fatal("Error running %s --version: %s" % (compiler, output)) | 237 | bb.fatal("Error running %s --version: %s" % (compiler, output)) |
@@ -316,8 +316,8 @@ def write_ld_so_conf(d): | |||
316 | bb.utils.remove(ldsoconf) | 316 | bb.utils.remove(ldsoconf) |
317 | bb.utils.mkdirhier(os.path.dirname(ldsoconf)) | 317 | bb.utils.mkdirhier(os.path.dirname(ldsoconf)) |
318 | with open(ldsoconf, "w") as f: | 318 | with open(ldsoconf, "w") as f: |
319 | f.write(d.getVar("base_libdir", True) + '\n') | 319 | f.write(d.getVar("base_libdir") + '\n') |
320 | f.write(d.getVar("libdir", True) + '\n') | 320 | f.write(d.getVar("libdir") + '\n') |
321 | 321 | ||
322 | class ImageQAFailed(bb.build.FuncFailed): | 322 | class ImageQAFailed(bb.build.FuncFailed): |
323 | def __init__(self, description, name=None, logfile=None): | 323 | def __init__(self, description, name=None, logfile=None): |