summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2014-04-24 15:59:20 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-25 17:19:19 +0100
commit4c14b094985216c433d330fb3d9532d4b6c91fcf (patch)
tree6970f383436ca29450779bd98c378aae89f2e079 /meta/classes
parent08a38a7865c41ec60f4b993b964f8d477ea0f680 (diff)
downloadpoky-4c14b094985216c433d330fb3d9532d4b6c91fcf.tar.gz
Globally replace 'base_contains' calls with 'bb.utils.contains'
The base_contains is kept as a compatibility method and we ought to not use it in OE-Core so we can remove it from base metadata in future. (From OE-Core rev: d83b16dbf0862be387f84228710cb165c6d2b03b) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/boot-directdisk.bbclass10
-rw-r--r--meta/classes/bootimg.bbclass8
-rw-r--r--meta/classes/buildhistory.bbclass8
-rw-r--r--meta/classes/core-image.bbclass4
-rw-r--r--meta/classes/image.bbclass20
-rw-r--r--meta/classes/packagegroup.bbclass2
-rw-r--r--meta/classes/ptest.bbclass4
-rw-r--r--meta/classes/rootfs_rpm.bbclass2
8 files changed, 29 insertions, 29 deletions
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass
index 88e5c52e2b..0da9932f4f 100644
--- a/meta/classes/boot-directdisk.bbclass
+++ b/meta/classes/boot-directdisk.bbclass
@@ -31,17 +31,17 @@ EXCLUDE_FROM_WORLD = "1"
31BOOTDD_VOLUME_ID ?= "boot" 31BOOTDD_VOLUME_ID ?= "boot"
32BOOTDD_EXTRA_SPACE ?= "16384" 32BOOTDD_EXTRA_SPACE ?= "16384"
33 33
34EFI = "${@base_contains("MACHINE_FEATURES", "efi", "1", "0", d)}" 34EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
35EFI_PROVIDER ?= "grub-efi" 35EFI_PROVIDER ?= "grub-efi"
36EFI_CLASS = "${@base_contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}" 36EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
37 37
38# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not 38# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
39# contain "efi". This way legacy is supported by default if neither is 39# contain "efi". This way legacy is supported by default if neither is
40# specified, maintaining the original behavior. 40# specified, maintaining the original behavior.
41def pcbios(d): 41def pcbios(d):
42 pcbios = base_contains("MACHINE_FEATURES", "pcbios", "1", "0", d) 42 pcbios = bb.utils.contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
43 if pcbios == "0": 43 if pcbios == "0":
44 pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d) 44 pcbios = bb.utils.contains("MACHINE_FEATURES", "efi", "0", "1", d)
45 return pcbios 45 return pcbios
46 46
47def pcbios_class(d): 47def pcbios_class(d):
@@ -62,7 +62,7 @@ DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}"
62SYSLINUX_ROOT ?= "root=/dev/sda2" 62SYSLINUX_ROOT ?= "root=/dev/sda2"
63SYSLINUX_TIMEOUT ?= "10" 63SYSLINUX_TIMEOUT ?= "10"
64 64
65IS_VMDK = '${@base_contains("IMAGE_FSTYPES", "vmdk", "true", "false", d)}' 65IS_VMDK = '${@bb.utils.contains("IMAGE_FSTYPES", "vmdk", "true", "false", d)}'
66 66
67boot_direct_populate() { 67boot_direct_populate() {
68 dest=$1 68 dest=$1
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index b13eef965d..7678567600 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -41,17 +41,17 @@ COMPRESSISO ?= "0"
41BOOTIMG_VOLUME_ID ?= "boot" 41BOOTIMG_VOLUME_ID ?= "boot"
42BOOTIMG_EXTRA_SPACE ?= "512" 42BOOTIMG_EXTRA_SPACE ?= "512"
43 43
44EFI = "${@base_contains("MACHINE_FEATURES", "efi", "1", "0", d)}" 44EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
45EFI_PROVIDER ?= "grub-efi" 45EFI_PROVIDER ?= "grub-efi"
46EFI_CLASS = "${@base_contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}" 46EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
47 47
48# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not 48# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
49# contain "efi". This way legacy is supported by default if neither is 49# contain "efi". This way legacy is supported by default if neither is
50# specified, maintaining the original behavior. 50# specified, maintaining the original behavior.
51def pcbios(d): 51def pcbios(d):
52 pcbios = base_contains("MACHINE_FEATURES", "pcbios", "1", "0", d) 52 pcbios = bb.utils.contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
53 if pcbios == "0": 53 if pcbios == "0":
54 pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d) 54 pcbios = bb.utils.contains("MACHINE_FEATURES", "efi", "0", "1", d)
55 return pcbios 55 return pcbios
56 56
57PCBIOS = "${@pcbios(d)}" 57PCBIOS = "${@pcbios(d)}"
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 262095f60a..d75e7e6fff 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -403,7 +403,7 @@ buildhistory_get_image_installed() {
403 # Anything requiring the use of the packaging system should be done in here 403 # Anything requiring the use of the packaging system should be done in here
404 # in case the packaging files are going to be removed for this image 404 # in case the packaging files are going to be removed for this image
405 405
406 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then 406 if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
407 return 407 return
408 fi 408 fi
409 409
@@ -414,7 +414,7 @@ buildhistory_get_sdk_installed() {
414 # Anything requiring the use of the packaging system should be done in here 414 # Anything requiring the use of the packaging system should be done in here
415 # in case the packaging files are going to be removed for this SDK 415 # in case the packaging files are going to be removed for this SDK
416 416
417 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then 417 if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
418 return 418 return
419 fi 419 fi
420 420
@@ -437,7 +437,7 @@ buildhistory_list_files() {
437 437
438 438
439buildhistory_get_imageinfo() { 439buildhistory_get_imageinfo() {
440 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then 440 if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
441 return 441 return
442 fi 442 fi
443 443
@@ -469,7 +469,7 @@ END
469} 469}
470 470
471buildhistory_get_sdkinfo() { 471buildhistory_get_sdkinfo() {
472 if [ "${@base_contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then 472 if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
473 return 473 return
474 fi 474 fi
475 475
diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass
index 7475d7d8d5..1b36cba773 100644
--- a/meta/classes/core-image.bbclass
+++ b/meta/classes/core-image.bbclass
@@ -73,7 +73,7 @@ inherit image
73ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; " 73ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
74 74
75# Zap the root password if debug-tweaks feature is not enabled 75# Zap the root password if debug-tweaks feature is not enabled
76ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_empty_root_password ; ",d)}' 76ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "", "zap_empty_root_password ; ",d)}'
77 77
78# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled 78# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
79ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}' 79ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 79de5a2cae..ceee8481e6 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -25,7 +25,7 @@ IMAGE_FEATURES[type] = "list"
25IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs" 25IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs"
26 26
27# rootfs bootstrap install 27# rootfs bootstrap install
28ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}" 28ROOTFS_BOOTSTRAP_INSTALL = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
29 29
30# packages to install from features 30# packages to install from features
31FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}" 31FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
@@ -79,9 +79,9 @@ do_rootfs[vardeps] += "BAD_RECOMMENDATIONS NO_RECOMMENDATIONS"
79do_build[depends] += "virtual/kernel:do_deploy" 79do_build[depends] += "virtual/kernel:do_deploy"
80 80
81def build_live(d): 81def build_live(d):
82 if base_contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg 82 if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
83 d.setVar('NOISO', base_contains('IMAGE_FSTYPES', "iso", "0", "1", d)) 83 d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d))
84 d.setVar('NOHDD', base_contains('IMAGE_FSTYPES', "hddimg", "0", "1", d)) 84 d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
85 if d.getVar('NOISO', True) == "0" or d.getVar('NOHDD', True) == "0": 85 if d.getVar('NOISO', True) == "0" or d.getVar('NOHDD', True) == "0":
86 return "image-live" 86 return "image-live"
87 return "" 87 return ""
@@ -90,7 +90,7 @@ def build_live(d):
90IMAGE_TYPE_live = "${@build_live(d)}" 90IMAGE_TYPE_live = "${@build_live(d)}"
91 91
92inherit ${IMAGE_TYPE_live} 92inherit ${IMAGE_TYPE_live}
93IMAGE_TYPE_vmdk = '${@base_contains("IMAGE_FSTYPES", "vmdk", "image-vmdk", "", d)}' 93IMAGE_TYPE_vmdk = '${@bb.utils.contains("IMAGE_FSTYPES", "vmdk", "image-vmdk", "", d)}'
94inherit ${IMAGE_TYPE_vmdk} 94inherit ${IMAGE_TYPE_vmdk}
95 95
96python () { 96python () {
@@ -143,17 +143,17 @@ inherit ${IMAGE_CLASSES}
143IMAGE_POSTPROCESS_COMMAND ?= "" 143IMAGE_POSTPROCESS_COMMAND ?= ""
144MACHINE_POSTPROCESS_COMMAND ?= "" 144MACHINE_POSTPROCESS_COMMAND ?= ""
145# Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled 145# Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled
146ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "ssh_allow_empty_password; ", "",d)}' 146ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "ssh_allow_empty_password; ", "",d)}'
147# Enable postinst logging if debug-tweaks is enabled 147# Enable postinst logging if debug-tweaks is enabled
148ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "postinst_enable_logging; ", "",d)}' 148ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "postinst_enable_logging; ", "",d)}'
149# Write manifest 149# Write manifest
150IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest" 150IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest"
151ROOTFS_POSTPROCESS_COMMAND =+ "write_image_manifest ; " 151ROOTFS_POSTPROCESS_COMMAND =+ "write_image_manifest ; "
152# Set default postinst log file 152# Set default postinst log file
153POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log" 153POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
154# Set default target for systemd images 154# Set default target for systemd images
155SYSTEMD_DEFAULT_TARGET ?= '${@base_contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}' 155SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
156ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}' 156ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}'
157 157
158# some default locales 158# some default locales
159IMAGE_LINGUAS ?= "de-de fr-fr en-gb" 159IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
@@ -173,7 +173,7 @@ do_rootfs[umask] = "022"
173# A hook function to support read-only-rootfs IMAGE_FEATURES 173# A hook function to support read-only-rootfs IMAGE_FEATURES
174# Currently, it only supports sysvinit system. 174# Currently, it only supports sysvinit system.
175read_only_rootfs_hook () { 175read_only_rootfs_hook () {
176 if ${@base_contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then 176 if ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then
177 # Tweak the mount option and fs_passno for rootfs in fstab 177 # Tweak the mount option and fs_passno for rootfs in fstab
178 sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab 178 sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab
179 # Change the value of ROOTFS_READ_ONLY in /etc/default/rcS to yes 179 # Change the value of ROOTFS_READ_ONLY in /etc/default/rcS to yes
diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
index 9bc9cc22ad..6606bc6f71 100644
--- a/meta/classes/packagegroup.bbclass
+++ b/meta/classes/packagegroup.bbclass
@@ -41,7 +41,7 @@ do_populate_sysroot[noexec] = "1"
41 41
42python () { 42python () {
43 initman = d.getVar("VIRTUAL-RUNTIME_init_manager", True) 43 initman = d.getVar("VIRTUAL-RUNTIME_init_manager", True)
44 if initman and initman in ['sysvinit', 'systemd'] and not base_contains('DISTRO_FEATURES', initman, True, False, d): 44 if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d):
45 bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman) 45 bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman)
46} 46}
47 47
diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
index 5c5505d9b2..c96e74fd9e 100644
--- a/meta/classes/ptest.bbclass
+++ b/meta/classes/ptest.bbclass
@@ -6,14 +6,14 @@ PTEST_PATH ?= "${libdir}/${PN}/ptest"
6FILES_${PN}-ptest = "${PTEST_PATH}" 6FILES_${PN}-ptest = "${PTEST_PATH}"
7SECTION_${PN}-ptest = "devel" 7SECTION_${PN}-ptest = "devel"
8ALLOW_EMPTY_${PN}-ptest = "1" 8ALLOW_EMPTY_${PN}-ptest = "1"
9PTEST_ENABLED = "${@base_contains('DISTRO_FEATURES', 'ptest', '1', '0', d)}" 9PTEST_ENABLED = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '1', '0', d)}"
10PTEST_ENABLED_class-native = "" 10PTEST_ENABLED_class-native = ""
11PTEST_ENABLED_class-nativesdk = "" 11PTEST_ENABLED_class-nativesdk = ""
12PTEST_ENABLED_class-cross-canadian = "" 12PTEST_ENABLED_class-cross-canadian = ""
13RDEPENDS_${PN}-ptest_class-native = "" 13RDEPENDS_${PN}-ptest_class-native = ""
14RDEPENDS_${PN}-ptest_class-nativesdk = "" 14RDEPENDS_${PN}-ptest_class-nativesdk = ""
15 15
16PACKAGES =+ "${@base_contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}" 16PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
17 17
18do_configure_ptest() { 18do_configure_ptest() {
19 : 19 :
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 4b02247d49..9e97d341d9 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -6,7 +6,7 @@ ROOTFS_PKGMANAGE = "rpm smartpm"
6ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts" 6ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
7 7
8# Add 50Meg of extra space for Smart 8# Add 50Meg of extra space for Smart
9IMAGE_ROOTFS_EXTRA_SPACE_append = "${@base_contains("PACKAGE_INSTALL", "smartpm", " + 51200", "" ,d)}" 9IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "smartpm", " + 51200", "" ,d)}"
10 10
11# Smart is python based, so be sure python-native is available to us. 11# Smart is python based, so be sure python-native is available to us.
12EXTRANATIVEPATH += "python-native" 12EXTRANATIVEPATH += "python-native"