diff options
| author | Joshua Lock <joshua.g.lock@intel.com> | 2016-12-14 21:13:04 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-16 10:23:23 +0000 |
| commit | c4e2c59088765d1f1de7ec57cde91980f887c2ff (patch) | |
| tree | a2fda8ac5916fb59a711e9220c2177008cca9347 /meta/classes/sanity.bbclass | |
| parent | d5e67725ac11e3296cad104470931ffa16824b90 (diff) | |
| download | poky-c4e2c59088765d1f1de7ec57cde91980f887c2ff.tar.gz | |
meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.
Search made with the following regex: getVar ?\(( ?[^,()]*), True\)
(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
| -rw-r--r-- | meta/classes/sanity.bbclass | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 921b248b78..9674ae9580 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
| @@ -6,7 +6,7 @@ SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar \ | |||
| 6 | gzip gawk chrpath wget cpio perl file" | 6 | gzip gawk chrpath wget cpio perl file" |
| 7 | 7 | ||
| 8 | def bblayers_conf_file(d): | 8 | def bblayers_conf_file(d): |
| 9 | return os.path.join(d.getVar('TOPDIR', True), 'conf/bblayers.conf') | 9 | return os.path.join(d.getVar('TOPDIR'), 'conf/bblayers.conf') |
| 10 | 10 | ||
| 11 | def sanity_conf_read(fn): | 11 | def sanity_conf_read(fn): |
| 12 | with open(fn, 'r') as f: | 12 | with open(fn, 'r') as f: |
| @@ -39,8 +39,8 @@ SANITY_DIFF_TOOL ?= "meld" | |||
| 39 | SANITY_LOCALCONF_SAMPLE ?= "${COREBASE}/meta*/conf/local.conf.sample" | 39 | SANITY_LOCALCONF_SAMPLE ?= "${COREBASE}/meta*/conf/local.conf.sample" |
| 40 | python oecore_update_localconf() { | 40 | python oecore_update_localconf() { |
| 41 | # Check we are using a valid local.conf | 41 | # Check we are using a valid local.conf |
| 42 | current_conf = d.getVar('CONF_VERSION', True) | 42 | current_conf = d.getVar('CONF_VERSION') |
| 43 | conf_version = d.getVar('LOCALCONF_VERSION', True) | 43 | conf_version = d.getVar('LOCALCONF_VERSION') |
| 44 | 44 | ||
| 45 | failmsg = """Your version of local.conf was generated from an older/newer version of | 45 | failmsg = """Your version of local.conf was generated from an older/newer version of |
| 46 | local.conf.sample and there have been updates made to this file. Please compare the two | 46 | local.conf.sample and there have been updates made to this file. Please compare the two |
| @@ -59,8 +59,8 @@ is a good way to visualise the changes.""" | |||
| 59 | SANITY_SITECONF_SAMPLE ?= "${COREBASE}/meta*/conf/site.conf.sample" | 59 | SANITY_SITECONF_SAMPLE ?= "${COREBASE}/meta*/conf/site.conf.sample" |
| 60 | python oecore_update_siteconf() { | 60 | python oecore_update_siteconf() { |
| 61 | # If we have a site.conf, check it's valid | 61 | # If we have a site.conf, check it's valid |
| 62 | current_sconf = d.getVar('SCONF_VERSION', True) | 62 | current_sconf = d.getVar('SCONF_VERSION') |
| 63 | sconf_version = d.getVar('SITE_CONF_VERSION', True) | 63 | sconf_version = d.getVar('SITE_CONF_VERSION') |
| 64 | 64 | ||
| 65 | failmsg = """Your version of site.conf was generated from an older version of | 65 | failmsg = """Your version of site.conf was generated from an older version of |
| 66 | site.conf.sample and there have been updates made to this file. Please compare the two | 66 | site.conf.sample and there have been updates made to this file. Please compare the two |
| @@ -80,8 +80,8 @@ SANITY_BBLAYERCONF_SAMPLE ?= "${COREBASE}/meta*/conf/bblayers.conf.sample" | |||
| 80 | python oecore_update_bblayers() { | 80 | python oecore_update_bblayers() { |
| 81 | # bblayers.conf is out of date, so see if we can resolve that | 81 | # bblayers.conf is out of date, so see if we can resolve that |
| 82 | 82 | ||
| 83 | current_lconf = int(d.getVar('LCONF_VERSION', True)) | 83 | current_lconf = int(d.getVar('LCONF_VERSION')) |
| 84 | lconf_version = int(d.getVar('LAYER_CONF_VERSION', True)) | 84 | lconf_version = int(d.getVar('LAYER_CONF_VERSION')) |
| 85 | 85 | ||
| 86 | failmsg = """Your version of bblayers.conf has the wrong LCONF_VERSION (has ${LCONF_VERSION}, expecting ${LAYER_CONF_VERSION}). | 86 | failmsg = """Your version of bblayers.conf has the wrong LCONF_VERSION (has ${LCONF_VERSION}, expecting ${LAYER_CONF_VERSION}). |
| 87 | Please compare your file against bblayers.conf.sample and merge any changes before continuing. | 87 | Please compare your file against bblayers.conf.sample and merge any changes before continuing. |
| @@ -141,7 +141,7 @@ is a good way to visualise the changes.""" | |||
| 141 | # Handle rename of meta-yocto -> meta-poky | 141 | # Handle rename of meta-yocto -> meta-poky |
| 142 | # This marks the start of separate version numbers but code is needed in OE-Core | 142 | # This marks the start of separate version numbers but code is needed in OE-Core |
| 143 | # for the migration, one last time. | 143 | # for the migration, one last time. |
| 144 | layers = d.getVar('BBLAYERS', True).split() | 144 | layers = d.getVar('BBLAYERS').split() |
| 145 | layers = [ os.path.basename(path) for path in layers ] | 145 | layers = [ os.path.basename(path) for path in layers ] |
| 146 | if 'meta-yocto' in layers: | 146 | if 'meta-yocto' in layers: |
| 147 | found = False | 147 | found = False |
| @@ -172,7 +172,7 @@ is a good way to visualise the changes.""" | |||
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | def raise_sanity_error(msg, d, network_error=False): | 174 | def raise_sanity_error(msg, d, network_error=False): |
| 175 | if d.getVar("SANITY_USE_EVENTS", True) == "1": | 175 | if d.getVar("SANITY_USE_EVENTS") == "1": |
| 176 | try: | 176 | try: |
| 177 | bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d) | 177 | bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d) |
| 178 | except TypeError: | 178 | except TypeError: |
| @@ -198,7 +198,7 @@ def check_toolchain_tune_args(data, tune, multilib, errs): | |||
| 198 | return found_errors | 198 | return found_errors |
| 199 | 199 | ||
| 200 | def check_toolchain_args_present(data, tune, multilib, tune_errors, which): | 200 | def check_toolchain_args_present(data, tune, multilib, tune_errors, which): |
| 201 | args_set = (data.getVar("TUNE_%s" % which, True) or "").split() | 201 | args_set = (data.getVar("TUNE_%s" % which) or "").split() |
| 202 | args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune), True) or "").split() | 202 | args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune), True) or "").split() |
| 203 | args_missing = [] | 203 | args_missing = [] |
| 204 | 204 | ||
| @@ -228,7 +228,7 @@ def check_toolchain_tune(data, tune, multilib): | |||
| 228 | localdata.setVar("OVERRIDES", overrides) | 228 | localdata.setVar("OVERRIDES", overrides) |
| 229 | bb.data.update_data(localdata) | 229 | bb.data.update_data(localdata) |
| 230 | bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib)) | 230 | bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib)) |
| 231 | features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune, True) or "").split() | 231 | features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune) or "").split() |
| 232 | if not features: | 232 | if not features: |
| 233 | return "Tuning '%s' has no defined features, and cannot be used." % tune | 233 | return "Tuning '%s' has no defined features, and cannot be used." % tune |
| 234 | valid_tunes = localdata.getVarFlags('TUNEVALID') or {} | 234 | valid_tunes = localdata.getVarFlags('TUNEVALID') or {} |
| @@ -248,9 +248,9 @@ def check_toolchain_tune(data, tune, multilib): | |||
| 248 | bb.debug(2, " %s: %s" % (feature, valid_tunes[feature])) | 248 | bb.debug(2, " %s: %s" % (feature, valid_tunes[feature])) |
| 249 | else: | 249 | else: |
| 250 | tune_errors.append("Feature '%s' is not defined." % feature) | 250 | tune_errors.append("Feature '%s' is not defined." % feature) |
| 251 | whitelist = localdata.getVar("TUNEABI_WHITELIST", True) | 251 | whitelist = localdata.getVar("TUNEABI_WHITELIST") |
| 252 | if whitelist: | 252 | if whitelist: |
| 253 | tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune, True) | 253 | tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune) |
| 254 | if not tuneabi: | 254 | if not tuneabi: |
| 255 | tuneabi = tune | 255 | tuneabi = tune |
| 256 | if True not in [x in whitelist.split() for x in tuneabi.split()]: | 256 | if True not in [x in whitelist.split() for x in tuneabi.split()]: |
| @@ -264,13 +264,13 @@ def check_toolchain_tune(data, tune, multilib): | |||
| 264 | 264 | ||
| 265 | def check_toolchain(data): | 265 | def check_toolchain(data): |
| 266 | tune_error_set = [] | 266 | tune_error_set = [] |
| 267 | deftune = data.getVar("DEFAULTTUNE", True) | 267 | deftune = data.getVar("DEFAULTTUNE") |
| 268 | tune_errors = check_toolchain_tune(data, deftune, 'default') | 268 | tune_errors = check_toolchain_tune(data, deftune, 'default') |
| 269 | if tune_errors: | 269 | if tune_errors: |
| 270 | tune_error_set.append(tune_errors) | 270 | tune_error_set.append(tune_errors) |
| 271 | 271 | ||
| 272 | multilibs = (data.getVar("MULTILIB_VARIANTS", True) or "").split() | 272 | multilibs = (data.getVar("MULTILIB_VARIANTS") or "").split() |
| 273 | global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS", True) or "").split() | 273 | global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS") or "").split() |
| 274 | 274 | ||
| 275 | if multilibs: | 275 | if multilibs: |
| 276 | seen_libs = [] | 276 | seen_libs = [] |
| @@ -282,7 +282,7 @@ def check_toolchain(data): | |||
| 282 | seen_libs.append(lib) | 282 | seen_libs.append(lib) |
| 283 | if not lib in global_multilibs: | 283 | if not lib in global_multilibs: |
| 284 | tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib) | 284 | tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib) |
| 285 | tune = data.getVar("DEFAULTTUNE_virtclass-multilib-%s" % lib, True) | 285 | tune = data.getVar("DEFAULTTUNE_virtclass-multilib-%s" % lib) |
| 286 | if tune in seen_tunes: | 286 | if tune in seen_tunes: |
| 287 | tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune) | 287 | tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune) |
| 288 | else: | 288 | else: |
| @@ -360,10 +360,10 @@ def check_connectivity(d): | |||
| 360 | # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable | 360 | # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable |
| 361 | # using the same syntax as for SRC_URI. If the variable is not set | 361 | # using the same syntax as for SRC_URI. If the variable is not set |
| 362 | # the check is skipped | 362 | # the check is skipped |
| 363 | test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS', True) or "").split() | 363 | test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS') or "").split() |
| 364 | retval = "" | 364 | retval = "" |
| 365 | 365 | ||
| 366 | bbn = d.getVar('BB_NO_NETWORK', True) | 366 | bbn = d.getVar('BB_NO_NETWORK') |
| 367 | if bbn not in (None, '0', '1'): | 367 | if bbn not in (None, '0', '1'): |
| 368 | return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn | 368 | return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn |
| 369 | 369 | ||
| @@ -382,7 +382,7 @@ def check_connectivity(d): | |||
| 382 | except Exception as err: | 382 | except Exception as err: |
| 383 | # Allow the message to be configured so that users can be | 383 | # Allow the message to be configured so that users can be |
| 384 | # pointed to a support mechanism. | 384 | # pointed to a support mechanism. |
| 385 | msg = data.getVar('CONNECTIVITY_CHECK_MSG', True) or "" | 385 | msg = data.getVar('CONNECTIVITY_CHECK_MSG') or "" |
| 386 | if len(msg) == 0: | 386 | if len(msg) == 0: |
| 387 | msg = "%s.\n" % err | 387 | msg = "%s.\n" % err |
| 388 | msg += " Please ensure your host's network is configured correctly,\n" | 388 | msg += " Please ensure your host's network is configured correctly,\n" |
| @@ -395,7 +395,7 @@ def check_connectivity(d): | |||
| 395 | def check_supported_distro(sanity_data): | 395 | def check_supported_distro(sanity_data): |
| 396 | from fnmatch import fnmatch | 396 | from fnmatch import fnmatch |
| 397 | 397 | ||
| 398 | tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS', True) | 398 | tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS') |
| 399 | if not tested_distros: | 399 | if not tested_distros: |
| 400 | return | 400 | return |
| 401 | 401 | ||
| @@ -418,17 +418,17 @@ def check_sanity_validmachine(sanity_data): | |||
| 418 | messages = "" | 418 | messages = "" |
| 419 | 419 | ||
| 420 | # Check TUNE_ARCH is set | 420 | # Check TUNE_ARCH is set |
| 421 | if sanity_data.getVar('TUNE_ARCH', True) == 'INVALID': | 421 | if sanity_data.getVar('TUNE_ARCH') == 'INVALID': |
| 422 | messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n' | 422 | messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n' |
| 423 | 423 | ||
| 424 | # Check TARGET_OS is set | 424 | # Check TARGET_OS is set |
| 425 | if sanity_data.getVar('TARGET_OS', True) == 'INVALID': | 425 | if sanity_data.getVar('TARGET_OS') == 'INVALID': |
| 426 | messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' | 426 | messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' |
| 427 | 427 | ||
| 428 | # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS | 428 | # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS |
| 429 | pkgarchs = sanity_data.getVar('PACKAGE_ARCHS', True) | 429 | pkgarchs = sanity_data.getVar('PACKAGE_ARCHS') |
| 430 | tunepkg = sanity_data.getVar('TUNE_PKGARCH', True) | 430 | tunepkg = sanity_data.getVar('TUNE_PKGARCH') |
| 431 | defaulttune = sanity_data.getVar('DEFAULTTUNE', True) | 431 | defaulttune = sanity_data.getVar('DEFAULTTUNE') |
| 432 | tunefound = False | 432 | tunefound = False |
| 433 | seen = {} | 433 | seen = {} |
| 434 | dups = [] | 434 | dups = [] |
| @@ -476,7 +476,7 @@ def check_gcc_march(sanity_data): | |||
| 476 | result = True; | 476 | result = True; |
| 477 | 477 | ||
| 478 | if not result: | 478 | if not result: |
| 479 | build_arch = sanity_data.getVar('BUILD_ARCH', True) | 479 | build_arch = sanity_data.getVar('BUILD_ARCH') |
| 480 | status,res = oe.utils.getstatusoutput(sanity_data.expand("${BUILD_CC} -march=%s gcc_test.c -o gcc_test" % build_arch)) | 480 | status,res = oe.utils.getstatusoutput(sanity_data.expand("${BUILD_CC} -march=%s gcc_test.c -o gcc_test" % build_arch)) |
| 481 | if status == 0: | 481 | if status == 0: |
| 482 | message = "BUILD_CFLAGS_append = \" -march=%s\"" % build_arch | 482 | message = "BUILD_CFLAGS_append = \" -march=%s\"" % build_arch |
| @@ -564,11 +564,11 @@ def check_perl_modules(sanity_data): | |||
| 564 | return None | 564 | return None |
| 565 | 565 | ||
| 566 | def sanity_check_conffiles(d): | 566 | def sanity_check_conffiles(d): |
| 567 | funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS', True).split() | 567 | funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS').split() |
| 568 | for func in funcs: | 568 | for func in funcs: |
| 569 | conffile, current_version, required_version, func = func.split(":") | 569 | conffile, current_version, required_version, func = func.split(":") |
| 570 | if check_conf_exists(conffile, d) and d.getVar(current_version, True) is not None and \ | 570 | if check_conf_exists(conffile, d) and d.getVar(current_version) is not None and \ |
| 571 | d.getVar(current_version, True) != d.getVar(required_version, True): | 571 | d.getVar(current_version) != d.getVar(required_version): |
| 572 | try: | 572 | try: |
| 573 | bb.build.exec_func(func, d, pythonexception=True) | 573 | bb.build.exec_func(func, d, pythonexception=True) |
| 574 | except NotImplementedError as e: | 574 | except NotImplementedError as e: |
| @@ -581,8 +581,8 @@ def sanity_handle_abichanges(status, d): | |||
| 581 | # | 581 | # |
| 582 | import subprocess | 582 | import subprocess |
| 583 | 583 | ||
| 584 | current_abi = d.getVar('OELAYOUT_ABI', True) | 584 | current_abi = d.getVar('OELAYOUT_ABI') |
| 585 | abifile = d.getVar('SANITY_ABIFILE', True) | 585 | abifile = d.getVar('SANITY_ABIFILE') |
| 586 | if os.path.exists(abifile): | 586 | if os.path.exists(abifile): |
| 587 | with open(abifile, "r") as f: | 587 | with open(abifile, "r") as f: |
| 588 | abi = f.read().strip() | 588 | abi = f.read().strip() |
| @@ -677,12 +677,12 @@ def check_sanity_version_change(status, d): | |||
| 677 | missing = missing + "GNU make," | 677 | missing = missing + "GNU make," |
| 678 | 678 | ||
| 679 | if not check_app_exists('${BUILD_CC}', d): | 679 | if not check_app_exists('${BUILD_CC}', d): |
| 680 | missing = missing + "C Compiler (%s)," % d.getVar("BUILD_CC", True) | 680 | missing = missing + "C Compiler (%s)," % d.getVar("BUILD_CC") |
| 681 | 681 | ||
| 682 | if not check_app_exists('${BUILD_CXX}', d): | 682 | if not check_app_exists('${BUILD_CXX}', d): |
| 683 | missing = missing + "C++ Compiler (%s)," % d.getVar("BUILD_CXX", True) | 683 | missing = missing + "C++ Compiler (%s)," % d.getVar("BUILD_CXX") |
| 684 | 684 | ||
| 685 | required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES', True) | 685 | required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') |
| 686 | 686 | ||
| 687 | for util in required_utilities.split(): | 687 | for util in required_utilities.split(): |
| 688 | if not check_app_exists(util, d): | 688 | if not check_app_exists(util, d): |
| @@ -692,7 +692,7 @@ def check_sanity_version_change(status, d): | |||
| 692 | missing = missing.rstrip(',') | 692 | missing = missing.rstrip(',') |
| 693 | status.addresult("Please install the following missing utilities: %s\n" % missing) | 693 | status.addresult("Please install the following missing utilities: %s\n" % missing) |
| 694 | 694 | ||
| 695 | assume_provided = d.getVar('ASSUME_PROVIDED', True).split() | 695 | assume_provided = d.getVar('ASSUME_PROVIDED').split() |
| 696 | # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf | 696 | # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf |
| 697 | if "diffstat-native" not in assume_provided: | 697 | if "diffstat-native" not in assume_provided: |
| 698 | status.addresult('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n') | 698 | status.addresult('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n') |
| @@ -715,7 +715,7 @@ def check_sanity_version_change(status, d): | |||
| 715 | status.addresult(" __sync_bool_compare_and_swap (&atomic, 2, 3);\n") | 715 | status.addresult(" __sync_bool_compare_and_swap (&atomic, 2, 3);\n") |
| 716 | 716 | ||
| 717 | # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS) | 717 | # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS) |
| 718 | tmpdir = d.getVar('TMPDIR', True) | 718 | tmpdir = d.getVar('TMPDIR') |
| 719 | status.addresult(check_create_long_filename(tmpdir, "TMPDIR")) | 719 | status.addresult(check_create_long_filename(tmpdir, "TMPDIR")) |
| 720 | tmpdirmode = os.stat(tmpdir).st_mode | 720 | tmpdirmode = os.stat(tmpdir).st_mode |
| 721 | if (tmpdirmode & stat.S_ISGID): | 721 | if (tmpdirmode & stat.S_ISGID): |
| @@ -739,7 +739,7 @@ def check_sanity_version_change(status, d): | |||
| 739 | if netcheck: | 739 | if netcheck: |
| 740 | status.network_error = True | 740 | status.network_error = True |
| 741 | 741 | ||
| 742 | nolibs = d.getVar('NO32LIBS', True) | 742 | nolibs = d.getVar('NO32LIBS') |
| 743 | if not nolibs: | 743 | if not nolibs: |
| 744 | lib32path = '/lib' | 744 | lib32path = '/lib' |
| 745 | if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ): | 745 | if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ): |
| @@ -748,7 +748,7 @@ def check_sanity_version_change(status, d): | |||
| 748 | if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'): | 748 | if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'): |
| 749 | status.addresult("You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n") | 749 | status.addresult("You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n") |
| 750 | 750 | ||
| 751 | bbpaths = d.getVar('BBPATH', True).split(":") | 751 | bbpaths = d.getVar('BBPATH').split(":") |
| 752 | if ("." in bbpaths or "./" in bbpaths or "" in bbpaths): | 752 | if ("." in bbpaths or "./" in bbpaths or "" in bbpaths): |
| 753 | status.addresult("BBPATH references the current directory, either through " \ | 753 | status.addresult("BBPATH references the current directory, either through " \ |
| 754 | "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\ | 754 | "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\ |
| @@ -758,7 +758,7 @@ def check_sanity_version_change(status, d): | |||
| 758 | "references.\n" \ | 758 | "references.\n" \ |
| 759 | "Parsed BBPATH is" + str(bbpaths)); | 759 | "Parsed BBPATH is" + str(bbpaths)); |
| 760 | 760 | ||
| 761 | oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF', True) | 761 | oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF') |
| 762 | if not oes_bb_conf: | 762 | if not oes_bb_conf: |
| 763 | status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n') | 763 | status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n') |
| 764 | 764 | ||
| @@ -793,26 +793,26 @@ def check_sanity_everybuild(status, d): | |||
| 793 | 793 | ||
| 794 | # Check the bitbake version meets minimum requirements | 794 | # Check the bitbake version meets minimum requirements |
| 795 | from distutils.version import LooseVersion | 795 | from distutils.version import LooseVersion |
| 796 | minversion = d.getVar('BB_MIN_VERSION', True) | 796 | minversion = d.getVar('BB_MIN_VERSION') |
| 797 | if (LooseVersion(bb.__version__) < LooseVersion(minversion)): | 797 | if (LooseVersion(bb.__version__) < LooseVersion(minversion)): |
| 798 | status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__)) | 798 | status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__)) |
| 799 | 799 | ||
| 800 | sanity_check_locale(d) | 800 | sanity_check_locale(d) |
| 801 | 801 | ||
| 802 | paths = d.getVar('PATH', True).split(":") | 802 | paths = d.getVar('PATH').split(":") |
| 803 | if "." in paths or "./" in paths or "" in paths: | 803 | if "." in paths or "./" in paths or "" in paths: |
| 804 | status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") | 804 | status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") |
| 805 | 805 | ||
| 806 | # Check that the DISTRO is valid, if set | 806 | # Check that the DISTRO is valid, if set |
| 807 | # need to take into account DISTRO renaming DISTRO | 807 | # need to take into account DISTRO renaming DISTRO |
| 808 | distro = d.getVar('DISTRO', True) | 808 | distro = d.getVar('DISTRO') |
| 809 | if distro and distro != "nodistro": | 809 | if distro and distro != "nodistro": |
| 810 | if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ): | 810 | if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ): |
| 811 | status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO", True)) | 811 | status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO")) |
| 812 | 812 | ||
| 813 | # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't | 813 | # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't |
| 814 | # set, since so much relies on it being set. | 814 | # set, since so much relies on it being set. |
| 815 | dldir = d.getVar('DL_DIR', True) | 815 | dldir = d.getVar('DL_DIR') |
| 816 | if not dldir: | 816 | if not dldir: |
| 817 | status.addresult("DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n") | 817 | status.addresult("DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n") |
| 818 | if os.path.exists(dldir) and not os.access(dldir, os.W_OK): | 818 | if os.path.exists(dldir) and not os.access(dldir, os.W_OK): |
| @@ -821,7 +821,7 @@ def check_sanity_everybuild(status, d): | |||
| 821 | 821 | ||
| 822 | # Check that the MACHINE is valid, if it is set | 822 | # Check that the MACHINE is valid, if it is set |
| 823 | machinevalid = True | 823 | machinevalid = True |
| 824 | if d.getVar('MACHINE', True): | 824 | if d.getVar('MACHINE'): |
| 825 | if not check_conf_exists("conf/machine/${MACHINE}.conf", d): | 825 | if not check_conf_exists("conf/machine/${MACHINE}.conf", d): |
| 826 | status.addresult('Please set a valid MACHINE in your local.conf or environment\n') | 826 | status.addresult('Please set a valid MACHINE in your local.conf or environment\n') |
| 827 | machinevalid = False | 827 | machinevalid = False |
| @@ -834,7 +834,7 @@ def check_sanity_everybuild(status, d): | |||
| 834 | status.addresult(check_toolchain(d)) | 834 | status.addresult(check_toolchain(d)) |
| 835 | 835 | ||
| 836 | # Check that the SDKMACHINE is valid, if it is set | 836 | # Check that the SDKMACHINE is valid, if it is set |
| 837 | if d.getVar('SDKMACHINE', True): | 837 | if d.getVar('SDKMACHINE'): |
| 838 | if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d): | 838 | if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d): |
| 839 | status.addresult('Specified SDKMACHINE value is not valid\n') | 839 | status.addresult('Specified SDKMACHINE value is not valid\n') |
| 840 | elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}": | 840 | elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}": |
| @@ -847,7 +847,7 @@ def check_sanity_everybuild(status, d): | |||
| 847 | status.addresult("Please use a umask which allows a+rx and u+rwx\n") | 847 | status.addresult("Please use a umask which allows a+rx and u+rwx\n") |
| 848 | os.umask(omask) | 848 | os.umask(omask) |
| 849 | 849 | ||
| 850 | if d.getVar('TARGET_ARCH', True) == "arm": | 850 | if d.getVar('TARGET_ARCH') == "arm": |
| 851 | # This path is no longer user-readable in modern (very recent) Linux | 851 | # This path is no longer user-readable in modern (very recent) Linux |
| 852 | try: | 852 | try: |
| 853 | if os.path.exists("/proc/sys/vm/mmap_min_addr"): | 853 | if os.path.exists("/proc/sys/vm/mmap_min_addr"): |
| @@ -860,7 +860,7 @@ def check_sanity_everybuild(status, d): | |||
| 860 | except: | 860 | except: |
| 861 | pass | 861 | pass |
| 862 | 862 | ||
| 863 | oeroot = d.getVar('COREBASE', True) | 863 | oeroot = d.getVar('COREBASE') |
| 864 | if oeroot.find('+') != -1: | 864 | if oeroot.find('+') != -1: |
| 865 | status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.") | 865 | status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.") |
| 866 | if oeroot.find('@') != -1: | 866 | if oeroot.find('@') != -1: |
| @@ -875,7 +875,7 @@ def check_sanity_everybuild(status, d): | |||
| 875 | 'git', 'gitsm', 'hg', 'osc', 'p4', 'svn', \ | 875 | 'git', 'gitsm', 'hg', 'osc', 'p4', 'svn', \ |
| 876 | 'bzr', 'cvs', 'npm', 'sftp', 'ssh'] | 876 | 'bzr', 'cvs', 'npm', 'sftp', 'ssh'] |
| 877 | for mirror_var in mirror_vars: | 877 | for mirror_var in mirror_vars: |
| 878 | mirrors = (d.getVar(mirror_var, True) or '').replace('\\n', '\n').split('\n') | 878 | mirrors = (d.getVar(mirror_var) or '').replace('\\n', '\n').split('\n') |
| 879 | for mirror_entry in mirrors: | 879 | for mirror_entry in mirrors: |
| 880 | mirror_entry = mirror_entry.strip() | 880 | mirror_entry = mirror_entry.strip() |
| 881 | if not mirror_entry: | 881 | if not mirror_entry: |
| @@ -914,7 +914,7 @@ def check_sanity_everybuild(status, d): | |||
| 914 | check_symlink(mirror_base, d) | 914 | check_symlink(mirror_base, d) |
| 915 | 915 | ||
| 916 | # Check that TMPDIR hasn't changed location since the last time we were run | 916 | # Check that TMPDIR hasn't changed location since the last time we were run |
| 917 | tmpdir = d.getVar('TMPDIR', True) | 917 | tmpdir = d.getVar('TMPDIR') |
| 918 | checkfile = os.path.join(tmpdir, "saved_tmpdir") | 918 | checkfile = os.path.join(tmpdir, "saved_tmpdir") |
| 919 | if os.path.exists(checkfile): | 919 | if os.path.exists(checkfile): |
| 920 | with open(checkfile, "r") as f: | 920 | with open(checkfile, "r") as f: |
| @@ -951,8 +951,8 @@ def check_sanity(sanity_data): | |||
| 951 | 951 | ||
| 952 | status = SanityStatus() | 952 | status = SanityStatus() |
| 953 | 953 | ||
| 954 | tmpdir = sanity_data.getVar('TMPDIR', True) | 954 | tmpdir = sanity_data.getVar('TMPDIR') |
| 955 | sstate_dir = sanity_data.getVar('SSTATE_DIR', True) | 955 | sstate_dir = sanity_data.getVar('SSTATE_DIR') |
| 956 | 956 | ||
| 957 | check_symlink(sstate_dir, sanity_data) | 957 | check_symlink(sstate_dir, sanity_data) |
| 958 | 958 | ||
| @@ -976,7 +976,7 @@ def check_sanity(sanity_data): | |||
| 976 | 976 | ||
| 977 | check_sanity_everybuild(status, sanity_data) | 977 | check_sanity_everybuild(status, sanity_data) |
| 978 | 978 | ||
| 979 | sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1) | 979 | sanity_version = int(sanity_data.getVar('SANITY_VERSION') or 1) |
| 980 | network_error = False | 980 | network_error = False |
| 981 | # NATIVELSBSTRING var may have been overridden with "universal", so | 981 | # NATIVELSBSTRING var may have been overridden with "universal", so |
| 982 | # get actual host distribution id and version | 982 | # get actual host distribution id and version |
