diff options
author | Joshua Lock <josh@linux.intel.com> | 2012-05-23 15:42:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-24 08:51:41 +0100 |
commit | 2e12fcf3a1e03ec78775ff8f56af370c80e47671 (patch) | |
tree | bbd6286742174f10cf708c8c6284ac4f60813516 /meta/classes/sanity.bbclass | |
parent | 198304539159cdabb28a097c20fd939c73156172 (diff) | |
download | poky-2e12fcf3a1e03ec78775ff8f56af370c80e47671.tar.gz |
sanity.bbclass: data.getVar(VAR, obj, exp) -> obj.getVar(VAR, exp)
Replace calls to data.getVar(VARIABLE, data_object, expand) to
direct calls to the getVar method the the data_object.
(From OE-Core rev: 41ee978b62a9c40f36f8ad0acef147e36edffa17)
Signed-off-by: Joshua Lock <josh@linux.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 | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 5361f1fe2f..5cf9ea135b 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -236,20 +236,20 @@ def check_sanity_validmachine(sanity_data): | |||
236 | messages = "" | 236 | messages = "" |
237 | 237 | ||
238 | # Check TUNE_ARCH is set | 238 | # Check TUNE_ARCH is set |
239 | if data.getVar('TUNE_ARCH', sanity_data, True) == 'INVALID': | 239 | if sanity_data.getVar('TUNE_ARCH', True) == 'INVALID': |
240 | messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n' | 240 | messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n' |
241 | 241 | ||
242 | # Check TARGET_ARCH is set correctly | 242 | # Check TARGET_ARCH is set correctly |
243 | if data.getVar('TARGE_ARCH', sanity_data, False) == '${TUNE_ARCH}': | 243 | if sanity_data.getVar('TARGE_ARCH', False) == '${TUNE_ARCH}': |
244 | messages = messages + 'TARGET_ARCH is being overwritten, likely by your MACHINE configuration files.\nPlease use a valid tune configuration file which should set this correctly automatically\nand avoid setting this in the machine configuration. See the OE-Core mailing list for more information.\n' | 244 | messages = messages + 'TARGET_ARCH is being overwritten, likely by your MACHINE configuration files.\nPlease use a valid tune configuration file which should set this correctly automatically\nand avoid setting this in the machine configuration. See the OE-Core mailing list for more information.\n' |
245 | 245 | ||
246 | # Check TARGET_OS is set | 246 | # Check TARGET_OS is set |
247 | if data.getVar('TARGET_OS', sanity_data, True) == 'INVALID': | 247 | if sanity_data.getVar('TARGET_OS', True) == 'INVALID': |
248 | messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' | 248 | messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' |
249 | 249 | ||
250 | # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS | 250 | # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS |
251 | pkgarchs = data.getVar('PACKAGE_ARCHS', sanity_data, True) | 251 | pkgarchs = sanity_data.getVar('PACKAGE_ARCHS', True) |
252 | tunepkg = data.getVar('TUNE_PKGARCH', sanity_data, True) | 252 | tunepkg = sanity_data.getVar('TUNE_PKGARCH', True) |
253 | tunefound = False | 253 | tunefound = False |
254 | seen = {} | 254 | seen = {} |
255 | dups = [] | 255 | dups = [] |
@@ -281,7 +281,7 @@ def check_sanity(sanity_data): | |||
281 | import commands | 281 | import commands |
282 | 282 | ||
283 | # Check the bitbake version meets minimum requirements | 283 | # Check the bitbake version meets minimum requirements |
284 | minversion = data.getVar('BB_MIN_VERSION', sanity_data , True) | 284 | minversion = sanity_data.getVar('BB_MIN_VERSION', True) |
285 | if not minversion: | 285 | if not minversion: |
286 | # Hack: BB_MIN_VERSION hasn't been parsed yet so return | 286 | # Hack: BB_MIN_VERSION hasn't been parsed yet so return |
287 | # and wait for the next call | 287 | # and wait for the next call |
@@ -303,7 +303,7 @@ def check_sanity(sanity_data): | |||
303 | messages = messages + 'Bitbake version %s is required and version %s was found\n' % (minversion, __version__) | 303 | messages = messages + 'Bitbake version %s is required and version %s was found\n' % (minversion, __version__) |
304 | 304 | ||
305 | # Check that the MACHINE is valid, if it is set | 305 | # Check that the MACHINE is valid, if it is set |
306 | if data.getVar('MACHINE', sanity_data, True): | 306 | if sanity_data.getVar('MACHINE', True): |
307 | if not check_conf_exists("conf/machine/${MACHINE}.conf", sanity_data): | 307 | if not check_conf_exists("conf/machine/${MACHINE}.conf", sanity_data): |
308 | messages = messages + 'Please set a valid MACHINE in your local.conf or environment\n' | 308 | messages = messages + 'Please set a valid MACHINE in your local.conf or environment\n' |
309 | else: | 309 | else: |
@@ -312,33 +312,33 @@ def check_sanity(sanity_data): | |||
312 | messages = messages + 'Please set a MACHINE in your local.conf or environment\n' | 312 | messages = messages + 'Please set a MACHINE in your local.conf or environment\n' |
313 | 313 | ||
314 | # Check we are using a valid lacal.conf | 314 | # Check we are using a valid lacal.conf |
315 | current_conf = data.getVar('CONF_VERSION', sanity_data, True) | 315 | current_conf = sanity_data.getVar('CONF_VERSION', True) |
316 | conf_version = data.getVar('LOCALCONF_VERSION', sanity_data, True) | 316 | conf_version = sanity_data.getVar('LOCALCONF_VERSION', True) |
317 | 317 | ||
318 | if current_conf != conf_version: | 318 | if current_conf != conf_version: |
319 | messages = messages + "Your version of local.conf was generated from an older version of local.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/local.conf conf/local.conf.sample\" is a good way to visualise the changes.\n" | 319 | messages = messages + "Your version of local.conf was generated from an older version of local.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/local.conf conf/local.conf.sample\" is a good way to visualise the changes.\n" |
320 | 320 | ||
321 | # Check bblayers.conf is valid | 321 | # Check bblayers.conf is valid |
322 | current_lconf = data.getVar('LCONF_VERSION', sanity_data, True) | 322 | current_lconf = sanity_data.getVar('LCONF_VERSION', True) |
323 | lconf_version = data.getVar('LAYER_CONF_VERSION', sanity_data, True) | 323 | lconf_version = sanity_data.getVar('LAYER_CONF_VERSION', True) |
324 | if current_lconf != lconf_version: | 324 | if current_lconf != lconf_version: |
325 | messages = messages + "Your version of bblayers.conf was generated from an older version of bblayers.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/bblayers.conf conf/bblayers.conf.sample\" is a good way to visualise the changes.\n" | 325 | messages = messages + "Your version of bblayers.conf was generated from an older version of bblayers.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/bblayers.conf conf/bblayers.conf.sample\" is a good way to visualise the changes.\n" |
326 | 326 | ||
327 | # If we have a site.conf, check it's valid | 327 | # If we have a site.conf, check it's valid |
328 | if check_conf_exists("conf/site.conf", sanity_data): | 328 | if check_conf_exists("conf/site.conf", sanity_data): |
329 | current_sconf = data.getVar('SCONF_VERSION', sanity_data, True) | 329 | current_sconf = sanity_data.getVar('SCONF_VERSION', True) |
330 | sconf_version = data.getVar('SITE_CONF_VERSION', sanity_data, True) | 330 | sconf_version = sanity_data.getVar('SITE_CONF_VERSION', True) |
331 | if current_sconf != sconf_version: | 331 | if current_sconf != sconf_version: |
332 | messages = messages + "Your version of site.conf was generated from an older version of site.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/site.conf conf/site.conf.sample\" is a good way to visualise the changes.\n" | 332 | messages = messages + "Your version of site.conf was generated from an older version of site.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/site.conf conf/site.conf.sample\" is a good way to visualise the changes.\n" |
333 | 333 | ||
334 | assume_provided = data.getVar('ASSUME_PROVIDED', sanity_data , True).split() | 334 | assume_provided = sanity_data.getVar('ASSUME_PROVIDED', True).split() |
335 | # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf | 335 | # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf |
336 | if "diffstat-native" not in assume_provided: | 336 | if "diffstat-native" not in assume_provided: |
337 | messages = messages + 'Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n' | 337 | messages = messages + 'Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n' |
338 | 338 | ||
339 | # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't | 339 | # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't |
340 | # set, since so much relies on it being set. | 340 | # set, since so much relies on it being set. |
341 | dldir = data.getVar('DL_DIR', sanity_data, True) | 341 | dldir = sanity_data.getVar('DL_DIR', True) |
342 | if not dldir: | 342 | if not dldir: |
343 | messages = messages + "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" | 343 | messages = messages + "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" |
344 | if os.path.exists(dldir) and not os.access(dldir, os.W_OK): | 344 | if os.path.exists(dldir) and not os.access(dldir, os.W_OK): |
@@ -346,10 +346,10 @@ def check_sanity(sanity_data): | |||
346 | 346 | ||
347 | # Check that the DISTRO is valid, if set | 347 | # Check that the DISTRO is valid, if set |
348 | # need to take into account DISTRO renaming DISTRO | 348 | # need to take into account DISTRO renaming DISTRO |
349 | distro = data.getVar('DISTRO', sanity_data, True) | 349 | distro = sanity_data.getVar('DISTRO', True) |
350 | if distro: | 350 | if distro: |
351 | if not ( check_conf_exists("conf/distro/${DISTRO}.conf", sanity_data) or check_conf_exists("conf/distro/include/${DISTRO}.inc", sanity_data) ): | 351 | if not ( check_conf_exists("conf/distro/${DISTRO}.conf", sanity_data) or check_conf_exists("conf/distro/include/${DISTRO}.inc", sanity_data) ): |
352 | messages = messages + "DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % data.getVar("DISTRO", sanity_data, True ) | 352 | messages = messages + "DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % sanity_data.getVar("DISTRO", True ) |
353 | 353 | ||
354 | missing = "" | 354 | missing = "" |
355 | 355 | ||
@@ -357,10 +357,10 @@ def check_sanity(sanity_data): | |||
357 | missing = missing + "GNU make," | 357 | missing = missing + "GNU make," |
358 | 358 | ||
359 | if not check_app_exists('${BUILD_PREFIX}gcc', sanity_data): | 359 | if not check_app_exists('${BUILD_PREFIX}gcc', sanity_data): |
360 | missing = missing + "C Compiler (%sgcc)," % data.getVar("BUILD_PREFIX", sanity_data, True) | 360 | missing = missing + "C Compiler (%sgcc)," % sanity_data.getVar("BUILD_PREFIX", True) |
361 | 361 | ||
362 | if not check_app_exists('${BUILD_PREFIX}g++', sanity_data): | 362 | if not check_app_exists('${BUILD_PREFIX}g++', sanity_data): |
363 | missing = missing + "C++ Compiler (%sg++)," % data.getVar("BUILD_PREFIX", sanity_data, True) | 363 | missing = missing + "C++ Compiler (%sg++)," % sanity_data.getVar("BUILD_PREFIX", True) |
364 | 364 | ||
365 | required_utilities = sanity_data.getVar('SANITY_REQUIRED_UTILITIES', True) | 365 | required_utilities = sanity_data.getVar('SANITY_REQUIRED_UTILITIES', True) |
366 | 366 | ||
@@ -368,11 +368,11 @@ def check_sanity(sanity_data): | |||
368 | if not check_app_exists("qemu-arm", sanity_data): | 368 | if not check_app_exists("qemu-arm", sanity_data): |
369 | messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH" | 369 | messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH" |
370 | 370 | ||
371 | paths = data.getVar('PATH', sanity_data, True).split(":") | 371 | paths = sanity_data.getVar('PATH', True).split(":") |
372 | if "." in paths or "" in paths: | 372 | if "." in paths or "" in paths: |
373 | messages = messages + "PATH contains '.' or '', which will break the build, please remove this." | 373 | messages = messages + "PATH contains '.' or '', which will break the build, please remove this." |
374 | 374 | ||
375 | if data.getVar('TARGET_ARCH', sanity_data, True) == "arm": | 375 | if sanity_data.getVar('TARGET_ARCH', True) == "arm": |
376 | # This path is no longer user-readable in modern (very recent) Linux | 376 | # This path is no longer user-readable in modern (very recent) Linux |
377 | try: | 377 | try: |
378 | if os.path.exists("/proc/sys/vm/mmap_min_addr"): | 378 | if os.path.exists("/proc/sys/vm/mmap_min_addr"): |
@@ -403,7 +403,7 @@ def check_sanity(sanity_data): | |||
403 | messages = messages + toolchain_msg + '\n' | 403 | messages = messages + toolchain_msg + '\n' |
404 | 404 | ||
405 | # Check if DISPLAY is set if IMAGETEST is set | 405 | # Check if DISPLAY is set if IMAGETEST is set |
406 | if not data.getVar( 'DISPLAY', sanity_data, True ) and data.getVar( 'IMAGETEST', sanity_data, True ) == 'qemu': | 406 | if not sanity_data.getVar( 'DISPLAY', True ) and sanity_data.getVar( 'IMAGETEST', True ) == 'qemu': |
407 | messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n' | 407 | messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n' |
408 | 408 | ||
409 | omask = os.umask(022) | 409 | omask = os.umask(022) |
@@ -411,11 +411,11 @@ def check_sanity(sanity_data): | |||
411 | messages = messages + "Please use a umask which allows a+rx and u+rwx\n" | 411 | messages = messages + "Please use a umask which allows a+rx and u+rwx\n" |
412 | os.umask(omask) | 412 | os.umask(omask) |
413 | 413 | ||
414 | oes_bb_conf = data.getVar( 'OES_BITBAKE_CONF', sanity_data, True ) | 414 | oes_bb_conf = sanity_data.getVar( 'OES_BITBAKE_CONF', True) |
415 | if not oes_bb_conf: | 415 | if not oes_bb_conf: |
416 | messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n' | 416 | messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n' |
417 | 417 | ||
418 | nolibs = data.getVar('NO32LIBS', sanity_data, True) | 418 | nolibs = sanity_data.getVar('NO32LIBS', True) |
419 | if not nolibs: | 419 | if not nolibs: |
420 | lib32path = '/lib' | 420 | lib32path = '/lib' |
421 | if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ): | 421 | if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ): |
@@ -424,8 +424,8 @@ def check_sanity(sanity_data): | |||
424 | if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'): | 424 | if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'): |
425 | messages = messages + "You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n" | 425 | messages = messages + "You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n" |
426 | 426 | ||
427 | tmpdir = data.getVar('TMPDIR', sanity_data, True) | 427 | tmpdir = sanity_data.getVar('TMPDIR', True) |
428 | sstate_dir = data.getVar('SSTATE_DIR', sanity_data, True) | 428 | sstate_dir = sanity_data.getVar('SSTATE_DIR', True) |
429 | 429 | ||
430 | # Check saved sanity info | 430 | # Check saved sanity info |
431 | last_sanity_version = 0 | 431 | last_sanity_version = 0 |
@@ -442,7 +442,7 @@ def check_sanity(sanity_data): | |||
442 | if line.startswith('SSTATE_DIR'): | 442 | if line.startswith('SSTATE_DIR'): |
443 | last_sstate_dir = line.split()[1] | 443 | last_sstate_dir = line.split()[1] |
444 | 444 | ||
445 | sanity_version = int(data.getVar('SANITY_VERSION', sanity_data, True) or 1) | 445 | sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1) |
446 | if last_sanity_version < sanity_version: | 446 | if last_sanity_version < sanity_version: |
447 | messages = messages + check_sanity_version_change(sanity_data) | 447 | messages = messages + check_sanity_version_change(sanity_data) |
448 | messages = messages + check_sanity_tmpdir_change(tmpdir, sanity_data) | 448 | messages = messages + check_sanity_tmpdir_change(tmpdir, sanity_data) |
@@ -476,8 +476,8 @@ def check_sanity(sanity_data): | |||
476 | # | 476 | # |
477 | # Check the 'ABI' of TMPDIR | 477 | # Check the 'ABI' of TMPDIR |
478 | # | 478 | # |
479 | current_abi = data.getVar('OELAYOUT_ABI', sanity_data, True) | 479 | current_abi = sanity_data.getVar('OELAYOUT_ABI', True) |
480 | abifile = data.getVar('SANITY_ABIFILE', sanity_data, True) | 480 | abifile = sanity_data.getVar('SANITY_ABIFILE', True) |
481 | if os.path.exists(abifile): | 481 | if os.path.exists(abifile): |
482 | f = file(abifile, "r") | 482 | f = file(abifile, "r") |
483 | abi = f.read().strip() | 483 | abi = f.read().strip() |
@@ -516,7 +516,7 @@ def check_sanity(sanity_data): | |||
516 | f.write(current_abi) | 516 | f.write(current_abi) |
517 | f.close() | 517 | f.close() |
518 | 518 | ||
519 | oeroot = data.getVar('COREBASE', sanity_data) | 519 | oeroot = sanity_data.getVar('COREBASE') |
520 | if oeroot.find ('+') != -1: | 520 | if oeroot.find ('+') != -1: |
521 | messages = messages + "Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include a +." | 521 | messages = messages + "Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include a +." |
522 | elif oeroot.find (' ') != -1: | 522 | elif oeroot.find (' ') != -1: |