From b22831fd63164c4db9c0b72934d7d734a6585251 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 9 Nov 2011 15:00:01 +0000 Subject: Convert to use direct access to the data store (instead of bb.data.*Var*()) This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` Signed-off-by: Richard Purdie --- .../recipes-gnome/abiword/abiword-2.5.inc | 2 +- meta-demoapps/recipes-gnome/abiword/abiword.inc | 2 +- .../recipes-support/poppler/poppler-fpu.inc | 2 +- meta/classes/autotools.bbclass | 6 +- meta/classes/base.bbclass | 114 +++++----- meta/classes/bugzilla.bbclass | 30 +-- meta/classes/buildstats.bbclass | 36 ++-- meta/classes/cpan-base.bbclass | 2 +- meta/classes/cpan_build.bbclass | 4 +- meta/classes/cross-canadian.bbclass | 2 +- meta/classes/debian.bbclass | 18 +- meta/classes/distrodata.bbclass | 162 +++++++------- meta/classes/distutils-base.bbclass | 2 +- meta/classes/distutils-native-base.bbclass | 2 +- meta/classes/gconf.bbclass | 16 +- meta/classes/gtk-icon-cache.bbclass | 24 +-- meta/classes/icecc.bbclass | 16 +- meta/classes/image-swab.bbclass | 4 +- meta/classes/image.bbclass | 20 +- meta/classes/image_types.bbclass | 4 +- meta/classes/imagetest-qemu.bbclass | 56 ++--- meta/classes/insane.bbclass | 78 +++---- meta/classes/kernel-arch.bbclass | 6 +- meta/classes/kernel-yocto.bbclass | 2 +- meta/classes/kernel.bbclass | 68 +++--- meta/classes/libc-common.bbclass | 10 +- meta/classes/libc-package.bbclass | 66 +++--- meta/classes/license.bbclass | 18 +- meta/classes/metadata_scm.bbclass | 2 +- meta/classes/native.bbclass | 12 +- meta/classes/nativesdk.bbclass | 14 +- meta/classes/package.bbclass | 232 ++++++++++----------- meta/classes/package_deb.bbclass | 82 ++++---- meta/classes/package_ipk.bbclass | 82 ++++---- meta/classes/package_rpm.bbclass | 136 ++++++------ meta/classes/package_tar.bbclass | 38 ++-- meta/classes/packagedata.bbclass | 8 +- meta/classes/packagehistory.bbclass | 8 +- meta/classes/patch.bbclass | 28 +-- meta/classes/pkg_distribute.bbclass | 2 +- meta/classes/pkg_metainfo.bbclass | 12 +- meta/classes/populate_sdk_deb.bbclass | 4 +- meta/classes/populate_sdk_rpm.bbclass | 2 +- meta/classes/qemu.bbclass | 2 +- meta/classes/qt4e.bbclass | 2 +- meta/classes/qt4x11.bbclass | 2 +- meta/classes/relocatable.bbclass | 2 +- meta/classes/rootfs_ipk.bbclass | 10 +- meta/classes/rootfs_rpm.bbclass | 14 +- meta/classes/sanity.bbclass | 10 +- meta/classes/siteconfig.bbclass | 2 +- meta/classes/siteinfo.bbclass | 2 +- meta/classes/sourcepkg.bbclass | 12 +- meta/classes/src_distribute.bbclass | 16 +- meta/classes/sstate.bbclass | 94 ++++----- meta/classes/staging.bbclass | 6 +- meta/classes/syslinux.bbclass | 34 +-- meta/classes/task.bbclass | 2 +- meta/classes/toolchain-scripts.bbclass | 6 +- meta/classes/update-alternatives.bbclass | 38 ++-- meta/classes/update-rc.d.bbclass | 36 ++-- meta/classes/useradd.bbclass | 8 +- meta/classes/utility-tasks.bbclass | 8 +- meta/classes/utils.bbclass | 4 +- meta/conf/bitbake.conf | 36 ++-- meta/conf/distro/defaultsetup.conf | 2 +- .../conf/machine/include/arm/feature-arm-thumb.inc | 2 +- meta/conf/machine/include/tune-thumb.inc | 8 +- meta/lib/oe/distro_check.py | 22 +- meta/lib/oe/patch.py | 4 +- meta/lib/oe/utils.py | 8 +- meta/recipes-bsp/grub/grub_0.97.bb | 2 +- meta/recipes-bsp/grub/grub_1.99.bb | 2 +- meta/recipes-bsp/uboot/u-boot_2011.03.bb | 2 +- meta/recipes-bsp/uboot/u-boot_2011.06.bb | 2 +- meta/recipes-bsp/x-load/x-load_git.bb | 2 +- meta/recipes-connectivity/connman/connman.inc | 2 +- meta/recipes-core/busybox/busybox.inc | 6 +- meta/recipes-core/eglibc/eglibc-options.inc | 6 +- meta/recipes-core/eglibc/eglibc-package.inc | 4 +- meta/recipes-core/eglibc/eglibc_2.13.bb | 4 +- meta/recipes-core/eglibc/eglibc_2.14.bb | 4 +- meta/recipes-core/glib-2.0/glib-2.0_2.30.0.bb | 2 +- meta/recipes-core/libxml/libxml2.inc | 4 +- meta/recipes-core/tasks/task-base.bb | 10 +- meta/recipes-core/tasks/task-core-sdk.bb | 6 +- meta/recipes-core/uclibc/uclibc-config.inc | 16 +- meta/recipes-core/uclibc/uclibc.inc | 10 +- meta/recipes-devtools/apt/apt-native.inc | 4 +- meta/recipes-devtools/apt/apt-package.inc | 8 +- meta/recipes-devtools/automake/automake.inc | 2 +- meta/recipes-devtools/cmake/cmake.inc | 2 +- meta/recipes-devtools/cmake/cmake_2.8.5.bb | 6 +- meta/recipes-devtools/gcc/gcc-common.inc | 8 +- meta/recipes-devtools/gcc/gcc-configure-common.inc | 2 +- .../gnu-config/gnu-config_20080123.bb | 2 +- meta/recipes-devtools/intltool/intltool.inc | 2 +- meta/recipes-devtools/opkg/opkg.inc | 2 +- meta/recipes-devtools/perl/perl_5.14.2.bb | 2 +- .../python/python-pygobject_2.27.91.bb | 2 +- meta/recipes-devtools/qemu/qemu-targets.inc | 2 +- .../unfs-server/unfs-server_2.1+2.2beta47.bb | 2 +- meta/recipes-extended/cups/cups14.inc | 2 +- meta/recipes-extended/lsof/lsof_4.85.bb | 6 +- meta/recipes-extended/pam/libpam_1.1.4.bb | 4 +- meta/recipes-extended/zip/zip.inc | 2 +- meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.24.0.bb | 2 +- meta/recipes-gnome/gtk+/gtk+_2.12.7.bb | 8 +- meta/recipes-gnome/gtk+/gtk+_2.16.6.bb | 8 +- meta/recipes-gnome/gtk+/gtk+_2.24.6.bb | 6 +- .../gtk-engines/gtk-engines_2.20.2.bb | 4 +- meta/recipes-graphics/cairo/cairo-fpu.inc | 2 +- meta/recipes-graphics/clutter/clutter-fpu.inc | 2 +- .../fontconfig/fontconfig-native_2.8.0.bb | 2 +- meta/recipes-graphics/mesa/mesa-dri.inc | 2 +- meta/recipes-graphics/pango/pango.inc | 2 +- meta/recipes-graphics/xorg-lib/libxft_2.2.0.bb | 4 +- meta/recipes-kernel/linux/linux-dtb.inc | 10 +- meta/recipes-kernel/linux/linux-yocto-rt_2.6.34.bb | 2 +- meta/recipes-kernel/linux/linux-yocto_2.6.34.bb | 2 +- meta/recipes-multimedia/alsa/alsa-fpu.inc | 2 +- .../gstreamer/gst-plugins-package.inc | 12 +- meta/recipes-multimedia/pulseaudio/pulseaudio.inc | 2 +- meta/recipes-qt/qt4/qt4.inc | 20 +- meta/recipes-qt/qt4/qt4_arch.inc | 6 +- meta/recipes-sato/puzzles/oh-puzzles_git.bb | 4 +- meta/recipes-sato/puzzles/puzzles_r9306.bb | 2 +- meta/recipes-support/attr/ea-acl.inc | 4 +- meta/recipes-support/boost/boost-36.inc | 10 +- scripts/jhbuild/jhbuild2oe.py | 28 +-- 130 files changed, 1058 insertions(+), 1058 deletions(-) diff --git a/meta-demoapps/recipes-gnome/abiword/abiword-2.5.inc b/meta-demoapps/recipes-gnome/abiword/abiword-2.5.inc index ce537df7ff..511ae97bef 100644 --- a/meta-demoapps/recipes-gnome/abiword/abiword-2.5.inc +++ b/meta-demoapps/recipes-gnome/abiword/abiword-2.5.inc @@ -9,7 +9,7 @@ RDEPENDS_${PN} = "glibc-gconv-ibm850 glibc-gconv-cp1252 \ SRC_URI = "http://www.abiword.org/downloads/abiword/${PV}/source/abiword-${PV}.tar.gz" #want 2.x from 2.x.y for the installation directory -SHRT_VER = "${@bb.data.getVar('PV',d,1).split('.')[0]}.${@bb.data.getVar('PV',d,1).split('.')[1]}" +SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}" FILES_${PN} += " \ ${datadir}/icons/* \ diff --git a/meta-demoapps/recipes-gnome/abiword/abiword.inc b/meta-demoapps/recipes-gnome/abiword/abiword.inc index 4ec0ba976a..036f98f348 100644 --- a/meta-demoapps/recipes-gnome/abiword/abiword.inc +++ b/meta-demoapps/recipes-gnome/abiword/abiword.inc @@ -17,7 +17,7 @@ SVNURI = "svn://svn.abisource.com/abiword/trunk;module=abiword;proto=http" SVNSRC = "${WORKDIR}/abi" #want 2.x from 2.x.y for the installation directory -SHRT_VER = "${@bb.data.getVar('PV',d,1).split('.')[0]}.${@bb.data.getVar('PV',d,1).split('.')[1]}" +SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}" FILES_${PN} += " \ ${datadir}/icons/* \ diff --git a/meta-demoapps/recipes-support/poppler/poppler-fpu.inc b/meta-demoapps/recipes-support/poppler/poppler-fpu.inc index a26273020a..2fbee13b51 100644 --- a/meta-demoapps/recipes-support/poppler/poppler-fpu.inc +++ b/meta-demoapps/recipes-support/poppler/poppler-fpu.inc @@ -1,6 +1,6 @@ def get_poppler_fpu_setting(bb, d): - if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: + if d.getVar('TARGET_FPU', 1) in [ 'soft' ]: return "--enable-fixedpoint" return "" diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass index 451c7fcc1e..37e7d4b482 100644 --- a/meta/classes/autotools.bbclass +++ b/meta/classes/autotools.bbclass @@ -1,8 +1,8 @@ def autotools_dep_prepend(d): - if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1): + if d.getVar('INHIBIT_AUTOTOOLS_DEPS', 1): return '' - pn = bb.data.getVar('PN', d, 1) + pn = d.getVar('PN', 1) deps = '' if pn in ['autoconf-native', 'automake-native', 'help2man-native']: @@ -13,7 +13,7 @@ def autotools_dep_prepend(d): deps += 'libtool-native ' if not bb.data.inherits_class('native', d) \ and not bb.data.inherits_class('cross', d) \ - and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1): + and not d.getVar('INHIBIT_DEFAULT_DEPS', 1): deps += 'libtool-cross ' return deps + 'gnu-config-native ' diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index f5397446dd..f3f798f9bf 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -60,9 +60,9 @@ def base_dep_prepend(d): # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not # we need that built is the responsibility of the patch function / class, not # the application. - if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d): - if (bb.data.getVar('HOST_SYS', d, 1) != - bb.data.getVar('BUILD_SYS', d, 1)): + if not d.getVar('INHIBIT_DEFAULT_DEPS'): + if (d.getVar('HOST_SYS', 1) != + d.getVar('BUILD_SYS', 1)): deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc " return deps @@ -73,13 +73,13 @@ DEPENDS_prepend="${BASEDEPENDS} " FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" # THISDIR only works properly with imediate expansion as it has to run # in the context of the location its used (:=) -THISDIR = "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" +THISDIR = "${@os.path.dirname(d.getVar('FILE', True))}" addtask fetch do_fetch[dirs] = "${DL_DIR}" python base_do_fetch() { - src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split() + src_uri = (d.getVar('SRC_URI', True) or "").split() if len(src_uri) == 0: return @@ -96,14 +96,14 @@ python base_do_fetch() { addtask unpack after do_fetch do_unpack[dirs] = "${WORKDIR}" python base_do_unpack() { - src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split() + src_uri = (d.getVar('SRC_URI', True) or "").split() if len(src_uri) == 0: return localdata = bb.data.createCopy(d) bb.data.update_data(localdata) - rootdir = bb.data.getVar('WORKDIR', localdata, True) + rootdir = localdata.getVar('WORKDIR', True) try: fetcher = bb.fetch2.Fetch(src_uri, localdata) @@ -118,7 +118,7 @@ def generate_git_config(e): from bb import data if data.getVar('GIT_CORE_CONFIG', e.data, True): - gitconfig_path = bb.data.getVar('GIT_CONFIG', e.data, True) + gitconfig_path = e.data.getVar('GIT_CONFIG', True) proxy_command = " gitproxy = %s\n" % data.getVar('GIT_PROXY_COMMAND', e.data, True) bb.mkdirhier(bb.data.expand("${STAGING_DIR_NATIVE}/usr/etc/", e.data)) @@ -207,11 +207,11 @@ python base_eventhandler() { name = getName(e) if name.startswith("BuildStarted"): - bb.data.setVar( 'BB_VERSION', bb.__version__, e.data ) + e.data.setVar( 'BB_VERSION', bb.__version__) statusvars = ['BB_VERSION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TUNE_FEATURES', 'TARGET_FPU'] - statuslines = ["%-17s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars] + statuslines = ["%-17s = \"%s\"" % (i, e.data.getVar(i, 1) or '') for i in statusvars] - layers = (bb.data.getVar("BBLAYERS", e.data, 1) or "").split() + layers = (e.data.getVar("BBLAYERS", 1) or "").split() layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \ base_get_metadata_git_branch(i, None).strip(), \ base_get_metadata_git_revision(i, None)) \ @@ -237,7 +237,7 @@ python base_eventhandler() { needed_vars = [ "TARGET_ARCH", "TARGET_OS" ] pesteruser = [] for v in needed_vars: - val = bb.data.getVar(v, e.data, 1) + val = e.data.getVar(v, 1) if not val or val == 'INVALID': pesteruser.append(v) if pesteruser: @@ -330,23 +330,23 @@ python () { appendVar('EXTRA_OECONF', extraconf) # If PRINC is set, try and increase the PR value by the amount specified - princ = bb.data.getVar('PRINC', d, True) + princ = d.getVar('PRINC', True) if princ: - pr = bb.data.getVar('PR', d, True) + pr = d.getVar('PR', True) pr_prefix = re.search("\D+",pr) prval = re.search("\d+",pr) if pr_prefix is None or prval is None: bb.error("Unable to analyse format of PR variable: %s" % pr) nval = int(prval.group(0)) + int(princ) pr = pr_prefix.group(0) + str(nval) + pr[prval.end():] - bb.data.setVar('PR', pr, d) + d.setVar('PR', pr) - pn = bb.data.getVar('PN', d, 1) - license = bb.data.getVar('LICENSE', d, True) + pn = d.getVar('PN', 1) + license = d.getVar('LICENSE', True) if license == "INVALID": bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn) - commercial_license = " %s " % bb.data.getVar('COMMERCIAL_LICENSE', d, 1) + commercial_license = " %s " % d.getVar('COMMERCIAL_LICENSE', 1) import re pnr = "[ \t]%s[ \t]" % pn.replace('+', "\+") if commercial_license and re.search(pnr, commercial_license): @@ -356,86 +356,86 @@ python () { # If we're building a target package we need to use fakeroot (pseudo) # in order to capture permissions, owners, groups and special files if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d): - bb.data.setVarFlag('do_configure', 'umask', 022, d) - bb.data.setVarFlag('do_compile', 'umask', 022, d) - deps = (bb.data.getVarFlag('do_install', 'depends', d) or "").split() + d.setVarFlag('do_configure', 'umask', 022) + d.setVarFlag('do_compile', 'umask', 022) + deps = (d.getVarFlag('do_install', 'depends') or "").split() deps.append('virtual/fakeroot-native:do_populate_sysroot') bb.data.setVarFlag('do_install', 'depends', " ".join(deps),d) - bb.data.setVarFlag('do_install', 'fakeroot', 1, d) - bb.data.setVarFlag('do_install', 'umask', 022, d) - deps = (bb.data.getVarFlag('do_package', 'depends', d) or "").split() + d.setVarFlag('do_install', 'fakeroot', 1) + d.setVarFlag('do_install', 'umask', 022) + deps = (d.getVarFlag('do_package', 'depends') or "").split() deps.append('virtual/fakeroot-native:do_populate_sysroot') bb.data.setVarFlag('do_package', 'depends', " ".join(deps),d) - bb.data.setVarFlag('do_package', 'fakeroot', 1, d) - bb.data.setVarFlag('do_package', 'umask', 022, d) - bb.data.setVarFlag('do_package_setscene', 'fakeroot', 1, d) - source_mirror_fetch = bb.data.getVar('SOURCE_MIRROR_FETCH', d, 0) + d.setVarFlag('do_package', 'fakeroot', 1) + d.setVarFlag('do_package', 'umask', 022) + d.setVarFlag('do_package_setscene', 'fakeroot', 1) + source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', 0) if not source_mirror_fetch: - need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1) + need_host = d.getVar('COMPATIBLE_HOST', 1) if need_host: import re - this_host = bb.data.getVar('HOST_SYS', d, 1) + this_host = d.getVar('HOST_SYS', 1) if not re.match(need_host, this_host): raise bb.parse.SkipPackage("incompatible with host %s" % this_host) - need_machine = bb.data.getVar('COMPATIBLE_MACHINE', d, 1) + need_machine = d.getVar('COMPATIBLE_MACHINE', 1) if need_machine: import re - this_machine = bb.data.getVar('MACHINE', d, 1) + this_machine = d.getVar('MACHINE', 1) if this_machine and not re.match(need_machine, this_machine): - this_soc_family = bb.data.getVar('SOC_FAMILY', d, 1) + this_soc_family = d.getVar('SOC_FAMILY', 1) if (this_soc_family and not re.match(need_machine, this_soc_family)) or not this_soc_family: raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine) - dont_want_license = bb.data.getVar('INCOMPATIBLE_LICENSE', d, 1) + dont_want_license = d.getVar('INCOMPATIBLE_LICENSE', 1) if dont_want_license and not pn.endswith("-native") and not pn.endswith("-cross") and not pn.endswith("-cross-initial") and not pn.endswith("-cross-intermediate") and not pn.endswith("-crosssdk-intermediate") and not pn.endswith("-crosssdk") and not pn.endswith("-crosssdk-initial"): - hosttools_whitelist = (bb.data.getVar('HOSTTOOLS_WHITELIST_%s' % dont_want_license, d, 1) or "").split() - lgplv2_whitelist = (bb.data.getVar('LGPLv2_WHITELIST_%s' % dont_want_license, d, 1) or "").split() - dont_want_whitelist = (bb.data.getVar('WHITELIST_%s' % dont_want_license, d, 1) or "").split() + hosttools_whitelist = (d.getVar('HOSTTOOLS_WHITELIST_%s' % dont_want_license, 1) or "").split() + lgplv2_whitelist = (d.getVar('LGPLv2_WHITELIST_%s' % dont_want_license, 1) or "").split() + dont_want_whitelist = (d.getVar('WHITELIST_%s' % dont_want_license, 1) or "").split() if pn not in hosttools_whitelist and pn not in lgplv2_whitelist and pn not in dont_want_whitelist: import re - this_license = bb.data.getVar('LICENSE', d, 1) + this_license = d.getVar('LICENSE', 1) if this_license and re.search(dont_want_license, this_license): bb.note("SKIPPING %s because it's %s" % (pn, this_license)) raise bb.parse.SkipPackage("incompatible with license %s" % this_license) # Git packages should DEPEND on git-native - srcuri = bb.data.getVar('SRC_URI', d, 1) + srcuri = d.getVar('SRC_URI', 1) if "git://" in srcuri: - depends = bb.data.getVarFlag('do_fetch', 'depends', d) or "" + depends = d.getVarFlag('do_fetch', 'depends') or "" depends = depends + " git-native:do_populate_sysroot" - bb.data.setVarFlag('do_fetch', 'depends', depends, d) + d.setVarFlag('do_fetch', 'depends', depends) # Mercurial packages should DEPEND on mercurial-native elif "hg://" in srcuri: - depends = bb.data.getVarFlag('do_fetch', 'depends', d) or "" + depends = d.getVarFlag('do_fetch', 'depends') or "" depends = depends + " mercurial-native:do_populate_sysroot" - bb.data.setVarFlag('do_fetch', 'depends', depends, d) + d.setVarFlag('do_fetch', 'depends', depends) # OSC packages should DEPEND on osc-native elif "osc://" in srcuri: - depends = bb.data.getVarFlag('do_fetch', 'depends', d) or "" + depends = d.getVarFlag('do_fetch', 'depends') or "" depends = depends + " osc-native:do_populate_sysroot" - bb.data.setVarFlag('do_fetch', 'depends', depends, d) + d.setVarFlag('do_fetch', 'depends', depends) # *.xz should depends on xz-native for unpacking # Not endswith because of "*.patch.xz;patch=1". Need bb.decodeurl in future if '.xz' in srcuri: - depends = bb.data.getVarFlag('do_unpack', 'depends', d) or "" + depends = d.getVarFlag('do_unpack', 'depends') or "" depends = depends + " xz-native:do_populate_sysroot" - bb.data.setVarFlag('do_unpack', 'depends', depends, d) + d.setVarFlag('do_unpack', 'depends', depends) # unzip-native should already be staged before unpacking ZIP recipes if ".zip" in srcuri: - depends = bb.data.getVarFlag('do_unpack', 'depends', d) or "" + depends = d.getVarFlag('do_unpack', 'depends') or "" depends = depends + " unzip-native:do_populate_sysroot" - bb.data.setVarFlag('do_unpack', 'depends', depends, d) + d.setVarFlag('do_unpack', 'depends', depends) # 'multimachine' handling - mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) - pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) + mach_arch = d.getVar('MACHINE_ARCH', 1) + pkg_arch = d.getVar('PACKAGE_ARCH', 1) if (pkg_arch == mach_arch): # Already machine specific - nothing further to do @@ -445,7 +445,7 @@ python () { # We always try to scan SRC_URI for urls with machine overrides # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0 # - override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1) + override = d.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', 1) if override != '0': paths = [] for p in [ "${PF}", "${P}", "${PN}", "files", "" ]: @@ -461,18 +461,18 @@ python () { for mp in paths: if local.startswith(mp): #bb.note("overriding PACKAGE_ARCH from %s to %s" % (pkg_arch, mach_arch)) - bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d) + d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}") return - packages = bb.data.getVar('PACKAGES', d, 1).split() + packages = d.getVar('PACKAGES', 1).split() for pkg in packages: - pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1) + pkgarch = d.getVar("PACKAGE_ARCH_%s" % pkg, 1) # We could look for != PACKAGE_ARCH here but how to choose # if multiple differences are present? # Look through PACKAGE_ARCHS for the priority order? if pkgarch and pkgarch == mach_arch: - bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d) + d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}") bb.warn("Recipe %s is marked as only being architecture specific but seems to have machine specific packages?! The recipe may as well mark itself as machine specific directly." % d.getVar("PN", True)) } @@ -483,7 +483,7 @@ python do_cleansstate() { addtask cleanall after do_cleansstate python do_cleanall() { - src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split() + src_uri = (d.getVar('SRC_URI', True) or "").split() if len(src_uri) == 0: return diff --git a/meta/classes/bugzilla.bbclass b/meta/classes/bugzilla.bbclass index 801bd66d2f..4028d261c8 100644 --- a/meta/classes/bugzilla.bbclass +++ b/meta/classes/bugzilla.bbclass @@ -109,14 +109,14 @@ python bugzilla_eventhandler() { return if name == "TaskFailed": - xmlrpc = bb.data.getVar("BUGZILLA_XMLRPC", data, True) - user = bb.data.getVar("BUGZILLA_USER", data, True) - passw = bb.data.getVar("BUGZILLA_PASS", data, True) - product = bb.data.getVar("BUGZILLA_PRODUCT", data, True) - compon = bb.data.getVar("BUGZILLA_COMPONENT", data, True) - version = bb.data.getVar("BUGZILLA_VERSION", data, True) - - proxy = bb.data.getVar('http_proxy', data, True ) + xmlrpc = data.getVar("BUGZILLA_XMLRPC", True) + user = data.getVar("BUGZILLA_USER", True) + passw = data.getVar("BUGZILLA_PASS", True) + product = data.getVar("BUGZILLA_PRODUCT", True) + compon = data.getVar("BUGZILLA_COMPONENT", True) + version = data.getVar("BUGZILLA_VERSION", True) + + proxy = data.getVar('http_proxy', True ) if (proxy): import urllib2 s, u, p, hostport = urllib2._parse_proxy(proxy) @@ -132,14 +132,14 @@ python bugzilla_eventhandler() { 'component': compon} # evil hack to figure out what is going on - debug_file = open(os.path.join(bb.data.getVar("TMPDIR", data, True),"..","bugzilla-log"),"a") + debug_file = open(os.path.join(data.getVar("TMPDIR", True),"..","bugzilla-log"),"a") file = None - bugname = "%(package)s-%(pv)s-autobuild" % { "package" : bb.data.getVar("PN", data, True), - "pv" : bb.data.getVar("PV", data, True), + bugname = "%(package)s-%(pv)s-autobuild" % { "package" : data.getVar("PN", True), + "pv" : data.getVar("PV", True), } - log_file = glob.glob("%s/log.%s.*" % (bb.data.getVar('T', event.data, True), event.task)) - text = "The %s step in %s failed at %s for machine %s" % (e.task, bb.data.getVar("PN", data, True), bb.data.getVar('DATETIME', data, True), bb.data.getVar( 'MACHINE', data, True ) ) + log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T', True), event.task)) + text = "The %s step in %s failed at %s for machine %s" % (e.task, data.getVar("PN", True), data.getVar('DATETIME', True), data.getVar( 'MACHINE', True ) ) if len(log_file) != 0: print >> debug_file, "Adding log file %s" % log_file[0] file = open(log_file[0], 'r') @@ -167,7 +167,7 @@ python bugzilla_eventhandler() { if bug_number and log: print >> debug_file, "The bug is known as '%s'" % bug_number - desc = "Build log for machine %s" % (bb.data.getVar('MACHINE', data, True)) + desc = "Build log for machine %s" % (data.getVar('MACHINE', True)) if not bugzilla_create_attachment(debug_file, server, args.copy(), bug_number, text, log_file[0], log, desc): print >> debug_file, "Failed to attach the build log for bug #%s" % bug_number else: @@ -181,6 +181,6 @@ python bugzilla_eventhandler() { # store bug number for oestats-client if bug_number: - bb.data.setVar('OESTATS_BUG_NUMBER', bug_number, data) + data.setVar('OESTATS_BUG_NUMBER', bug_number) } diff --git a/meta/classes/buildstats.bbclass b/meta/classes/buildstats.bbclass index 96c98d409f..4cd8fe6936 100644 --- a/meta/classes/buildstats.bbclass +++ b/meta/classes/buildstats.bbclass @@ -21,25 +21,25 @@ def get_cputime(): return sum(int(field) for field in fields) def set_bn(e): - bn = e.getPkgs()[0] + "-" + bb.data.getVar('MACHINE',e.data, True) + bn = e.getPkgs()[0] + "-" + e.data.getVar('MACHINE', True) try: - os.remove(bb.data.getVar('BNFILE', e.data, True)) + os.remove(e.data.getVar('BNFILE', True)) except: pass - file = open(bb.data.getVar('BNFILE', e.data, True), "w") - file.write(os.path.join(bn, bb.data.getVar('BUILDNAME', e.data, True))) + file = open(e.data.getVar('BNFILE', True), "w") + file.write(os.path.join(bn, e.data.getVar('BUILDNAME', True))) file.close() def get_bn(e): - file = open(bb.data.getVar('BNFILE', e.data, True)) + file = open(e.data.getVar('BNFILE', True)) bn = file.readline() file.close() return bn def set_device(e): - tmpdir = bb.data.getVar('TMPDIR', e.data, True) + tmpdir = e.data.getVar('TMPDIR', True) try: - os.remove(bb.data.getVar('DEVFILE', e.data, True)) + os.remove(e.data.getVar('DEVFILE', True)) except: pass ############################################################################ @@ -66,12 +66,12 @@ def set_device(e): rdev=line.split()[2] else: rdev="NoLogicalDevice" - file = open(bb.data.getVar('DEVFILE', e.data, True), "w") + file = open(e.data.getVar('DEVFILE', True), "w") file.write(rdev) file.close() def get_device(e): - file = open(bb.data.getVar('DEVFILE', e.data, True)) + file = open(e.data.getVar('DEVFILE', True)) device = file.readline() file.close() return device @@ -126,7 +126,7 @@ def get_timedata(var, data): def write_task_data(status, logfile, dev, e): bn = get_bn(e) - bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) taskdir = os.path.join(bsdir, bb.data.expand("${PF}", e.data)) file = open(os.path.join(logfile), "a") timedata = get_timedata("__timedata_task", e.data) @@ -168,7 +168,7 @@ python run_buildstats () { # set the buildname ######################################################################## try: - bb.mkdirhier(bb.data.getVar('BUILDSTATS_BASE', e.data, True)) + bb.mkdirhier(e.data.getVar('BUILDSTATS_BASE', True)) except: pass set_bn(e) @@ -176,7 +176,7 @@ python run_buildstats () { set_device(e) device = get_device(e) - bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) try: bb.mkdirhier(bsdir) except: @@ -199,7 +199,7 @@ python run_buildstats () { elif isinstance(e, bb.event.BuildCompleted): bn = get_bn(e) device = get_device(e) - bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) taskdir = os.path.join(bsdir, bb.data.expand("${PF}", e.data)) build_time = os.path.join(bsdir, "build_stats") file = open(build_time, "a") @@ -224,7 +224,7 @@ python run_buildstats () { if isinstance(e, bb.build.TaskStarted): bn = get_bn(e) device = get_device(e) - bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) taskdir = os.path.join(bsdir, bb.data.expand("${PF}", e.data)) if device != "NoLogicalDevice": set_diskdata("__diskdata_task", device, e.data) @@ -242,14 +242,14 @@ python run_buildstats () { elif isinstance(e, bb.build.TaskSucceeded): bn = get_bn(e) device = get_device(e) - bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) taskdir = os.path.join(bsdir, bb.data.expand("${PF}", e.data)) write_task_data("passed", os.path.join(taskdir, e.task), device, e) if e.task == "do_rootfs": - bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) bs=os.path.join(bsdir, "build_stats") file = open(bs,"a") - rootfs = bb.data.getVar('IMAGE_ROOTFS', e.data, True) + rootfs = e.data.getVar('IMAGE_ROOTFS', True) rootfs_size = subprocess.Popen(["du", "-sh", rootfs], stdout=subprocess.PIPE).stdout.read() file.write("Uncompressed Rootfs size: %s" % rootfs_size) file.close() @@ -257,7 +257,7 @@ python run_buildstats () { elif isinstance(e, bb.build.TaskFailed): bn = get_bn(e) device = get_device(e) - bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn) + bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn) taskdir = os.path.join(bsdir, bb.data.expand("${PF}", e.data)) write_task_data("failed", os.path.join(taskdir, e.task), device, e) ######################################################################## diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass index b5dbdaea81..79582ca76c 100644 --- a/meta/classes/cpan-base.bbclass +++ b/meta/classes/cpan-base.bbclass @@ -28,7 +28,7 @@ def get_perl_version(d): # Determine where the library directories are def perl_get_libdirs(d): - libdir = bb.data.getVar('libdir', d, 1) + libdir = d.getVar('libdir', 1) if is_target(d) == "no": libdir += '/perl-native' libdir += '/perl' diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass index cc503a424e..981332c4fa 100644 --- a/meta/classes/cpan_build.bbclass +++ b/meta/classes/cpan_build.bbclass @@ -10,9 +10,9 @@ inherit cpan-base # libmodule-build-perl) # def cpan_build_dep_prepend(d): - if bb.data.getVar('CPAN_BUILD_DEPS', d, 1): + if d.getVar('CPAN_BUILD_DEPS', 1): return '' - pn = bb.data.getVar('PN', d, 1) + pn = d.getVar('PN', 1) if pn in ['libmodule-build-perl', 'libmodule-build-perl-native']: return '' return 'libmodule-build-perl-native ' diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass index 601175db45..6f5bcd0ad4 100644 --- a/meta/classes/cross-canadian.bbclass +++ b/meta/classes/cross-canadian.bbclass @@ -16,7 +16,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S # PACKAGE_ARCH = "${SDK_ARCH}-nativesdk" python () { - archs = bb.data.getVar('PACKAGE_ARCHS', d, True).split() + archs = d.getVar('PACKAGE_ARCHS', True).split() sdkarchs = [] for arch in archs: sdkarchs.append(arch + '-nativesdk') diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass index 554525dc84..025abcfad0 100644 --- a/meta/classes/debian.bbclass +++ b/meta/classes/debian.bbclass @@ -22,8 +22,8 @@ python () { python debian_package_name_hook () { import glob, copy, stat, errno, re - pkgdest = bb.data.getVar('PKGDEST', d, 1) - packages = bb.data.getVar('PACKAGES', d, 1) + pkgdest = d.getVar('PKGDEST', 1) + packages = d.getVar('PACKAGES', 1) bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir", True)) + "$") lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir", True)) + "$") so_re = re.compile("lib.*\.so") @@ -60,7 +60,7 @@ python debian_package_name_hook () { for f in files: if so_re.match(f): fp = os.path.join(root, f) - cmd = (bb.data.getVar('BUILD_PREFIX', d, 1) or "") + "objdump -p " + fp + " 2>/dev/null" + cmd = (d.getVar('BUILD_PREFIX', 1) or "") + "objdump -p " + fp + " 2>/dev/null" fd = os.popen(cmd) lines = fd.readlines() fd.close() @@ -74,7 +74,7 @@ python debian_package_name_hook () { if len(sonames) == 1: soname = sonames[0] elif len(sonames) > 1: - lead = bb.data.getVar('LEAD_SONAME', d, 1) + lead = d.getVar('LEAD_SONAME', 1) if lead: r = re.compile(lead) filtered = [] @@ -95,21 +95,21 @@ python debian_package_name_hook () { if soname_result: (pkgname, devname) = soname_result for pkg in packages.split(): - if (bb.data.getVar('PKG_' + pkg, d) or bb.data.getVar('DEBIAN_NOAUTONAME_' + pkg, d)): + if (d.getVar('PKG_' + pkg) or d.getVar('DEBIAN_NOAUTONAME_' + pkg)): continue - debian_pn = bb.data.getVar('DEBIANNAME_' + pkg, d) + debian_pn = d.getVar('DEBIANNAME_' + pkg) if debian_pn: newpkg = debian_pn elif pkg == orig_pkg: newpkg = pkgname else: newpkg = pkg.replace(orig_pkg, devname, 1) - mlpre=bb.data.getVar('MLPREFIX', d, True) + mlpre=d.getVar('MLPREFIX', True) if mlpre: if not newpkg.find(mlpre) == 0: newpkg = mlpre + newpkg if newpkg != pkg: - bb.data.setVar('PKG_' + pkg, newpkg, d) + d.setVar('PKG_' + pkg, newpkg) # reversed sort is needed when some package is substring of another # ie in ncurses we get without reverse sort: @@ -117,7 +117,7 @@ python debian_package_name_hook () { # and later # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libticw orig_pkg ncurses-libtic debian_pn None newpkg libticw # so we need to handle ncurses-libticw->libticw5 before ncurses-libtic->libtic5 - for pkg in sorted((bb.data.getVar('AUTO_LIBNAME_PKGS', d, 1) or "").split(), reverse=True): + for pkg in sorted((d.getVar('AUTO_LIBNAME_PKGS', 1) or "").split(), reverse=True): auto_libname(packages, pkg) } diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass index ce7b931b13..687247a649 100644 --- a/meta/classes/distrodata.bbclass +++ b/meta/classes/distrodata.bbclass @@ -19,87 +19,87 @@ addtask distrodata_np do_distrodata_np[nostamp] = "1" python do_distrodata_np() { localdata = bb.data.createCopy(d) - pn = bb.data.getVar("PN", d, True) + pn = d.getVar("PN", True) bb.note("Package Name: %s" % pn) import oe.distro_check as dist_check - tmpdir = bb.data.getVar('TMPDIR', d, True) + tmpdir = d.getVar('TMPDIR', True) distro_check_dir = os.path.join(tmpdir, "distro_check") - datetime = bb.data.getVar('DATETIME', localdata, True) + datetime = localdata.getVar('DATETIME', True) dist_check.update_distro_data(distro_check_dir, datetime) if pn.find("-native") != -1: pnstripped = pn.split("-native") bb.note("Native Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pn.find("-nativesdk") != -1: pnstripped = pn.split("-nativesdk") bb.note("Native Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pn.find("-cross") != -1: pnstripped = pn.split("-cross") bb.note("cross Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pn.find("-crosssdk") != -1: pnstripped = pn.split("-crosssdk") bb.note("cross Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pn.find("-initial") != -1: pnstripped = pn.split("-initial") bb.note("initial Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) """generate package information from .bb file""" - pname = bb.data.getVar('PN', localdata, True) - pcurver = bb.data.getVar('PV', localdata, True) - pdesc = bb.data.getVar('DESCRIPTION', localdata, True) + pname = localdata.getVar('PN', True) + pcurver = localdata.getVar('PV', True) + pdesc = localdata.getVar('DESCRIPTION', True) if pdesc is not None: pdesc = pdesc.replace(',','') pdesc = pdesc.replace('\n','') - pgrp = bb.data.getVar('SECTION', localdata, True) - plicense = bb.data.getVar('LICENSE', localdata, True).replace(',','_') - if bb.data.getVar('LIC_FILES_CHKSUM', localdata, True): + pgrp = localdata.getVar('SECTION', True) + plicense = localdata.getVar('LICENSE', True).replace(',','_') + if localdata.getVar('LIC_FILES_CHKSUM', True): pchksum="1" else: pchksum="0" - if bb.data.getVar('RECIPE_STATUS', localdata, True): + if localdata.getVar('RECIPE_STATUS', True): hasrstatus="1" else: hasrstatus="0" - rstatus = bb.data.getVar('RECIPE_STATUS', localdata, True) + rstatus = localdata.getVar('RECIPE_STATUS', True) if rstatus is not None: rstatus = rstatus.replace(',','') - pupver = bb.data.getVar('RECIPE_LATEST_VERSION', localdata, True) + pupver = localdata.getVar('RECIPE_LATEST_VERSION', True) if pcurver == pupver: vermatch="1" else: vermatch="0" - noupdate_reason = bb.data.getVar('RECIPE_NO_UPDATE_REASON', localdata, True) + noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True) if noupdate_reason is None: noupdate="0" else: noupdate="1" noupdate_reason = noupdate_reason.replace(',','') - ris = bb.data.getVar('RECIPE_INTEL_SECTION', localdata, True) - maintainer = bb.data.getVar('RECIPE_MAINTAINER', localdata, True) - rttr = bb.data.getVar('RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES', localdata, True) - rlrd = bb.data.getVar('RECIPE_LATEST_RELEASE_DATE', localdata, True) - dc = bb.data.getVar('DEPENDENCY_CHECK', localdata, True) - rc = bb.data.getVar('RECIPE_COMMENTS', localdata, True) + ris = localdata.getVar('RECIPE_INTEL_SECTION', True) + maintainer = localdata.getVar('RECIPE_MAINTAINER', True) + rttr = localdata.getVar('RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES', True) + rlrd = localdata.getVar('RECIPE_LATEST_RELEASE_DATE', True) + dc = localdata.getVar('DEPENDENCY_CHECK', True) + rc = localdata.getVar('RECIPE_COMMENTS', True) result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata) bb.note("DISTRO: %s,%s,%s,%s,%s,%s,%s,%s,%s, %s, %s, %s\n" % \ @@ -113,81 +113,81 @@ python do_distrodata_np() { addtask distrodata do_distrodata[nostamp] = "1" python do_distrodata() { - logpath = bb.data.getVar('LOG_DIR', d, True) + logpath = d.getVar('LOG_DIR', True) bb.utils.mkdirhier(logpath) logfile = os.path.join(logpath, "distrodata.csv") import oe.distro_check as dist_check localdata = bb.data.createCopy(d) - tmpdir = bb.data.getVar('TMPDIR', d, True) + tmpdir = d.getVar('TMPDIR', True) distro_check_dir = os.path.join(tmpdir, "distro_check") - datetime = bb.data.getVar('DATETIME', localdata, True) + datetime = localdata.getVar('DATETIME', True) dist_check.update_distro_data(distro_check_dir, datetime) - pn = bb.data.getVar("PN", d, True) + pn = d.getVar("PN", True) bb.note("Package Name: %s" % pn) if pn.find("-native") != -1: pnstripped = pn.split("-native") bb.note("Native Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pn.find("-cross") != -1: pnstripped = pn.split("-cross") bb.note("cross Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pn.find("-initial") != -1: pnstripped = pn.split("-initial") bb.note("initial Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) """generate package information from .bb file""" - pname = bb.data.getVar('PN', localdata, True) - pcurver = bb.data.getVar('PV', localdata, True) - pdesc = bb.data.getVar('DESCRIPTION', localdata, True) + pname = localdata.getVar('PN', True) + pcurver = localdata.getVar('PV', True) + pdesc = localdata.getVar('DESCRIPTION', True) if pdesc is not None: pdesc = pdesc.replace(',','') pdesc = pdesc.replace('\n','') - pgrp = bb.data.getVar('SECTION', localdata, True) - plicense = bb.data.getVar('LICENSE', localdata, True).replace(',','_') - if bb.data.getVar('LIC_FILES_CHKSUM', localdata, True): + pgrp = localdata.getVar('SECTION', True) + plicense = localdata.getVar('LICENSE', True).replace(',','_') + if localdata.getVar('LIC_FILES_CHKSUM', True): pchksum="1" else: pchksum="0" - if bb.data.getVar('RECIPE_STATUS', localdata, True): + if localdata.getVar('RECIPE_STATUS', True): hasrstatus="1" else: hasrstatus="0" - rstatus = bb.data.getVar('RECIPE_STATUS', localdata, True) + rstatus = localdata.getVar('RECIPE_STATUS', True) if rstatus is not None: rstatus = rstatus.replace(',','') - pupver = bb.data.getVar('RECIPE_LATEST_VERSION', localdata, True) + pupver = localdata.getVar('RECIPE_LATEST_VERSION', True) if pcurver == pupver: vermatch="1" else: vermatch="0" - noupdate_reason = bb.data.getVar('RECIPE_NO_UPDATE_REASON', localdata, True) + noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True) if noupdate_reason is None: noupdate="0" else: noupdate="1" noupdate_reason = noupdate_reason.replace(',','') - ris = bb.data.getVar('RECIPE_INTEL_SECTION', localdata, True) - maintainer = bb.data.getVar('RECIPE_MAINTAINER', localdata, True) - rttr = bb.data.getVar('RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES', localdata, True) - rlrd = bb.data.getVar('RECIPE_LATEST_RELEASE_DATE', localdata, True) - dc = bb.data.getVar('DEPENDENCY_CHECK', localdata, True) - rc = bb.data.getVar('RECIPE_COMMENTS', localdata, True) + ris = localdata.getVar('RECIPE_INTEL_SECTION', True) + maintainer = localdata.getVar('RECIPE_MAINTAINER', True) + rttr = localdata.getVar('RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES', True) + rlrd = localdata.getVar('RECIPE_LATEST_RELEASE_DATE', True) + dc = localdata.getVar('DEPENDENCY_CHECK', True) + rc = localdata.getVar('RECIPE_COMMENTS', True) # do the comparison result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata) @@ -298,7 +298,7 @@ python do_checkpkg() { Clear internal url cache as it's a temporary check. Not doing so will have bitbake check url multiple times when looping through a single url """ - fn = bb.data.getVar('FILE', d, True) + fn = d.getVar('FILE', True) bb.fetch2.urldata_cache[fn] = {} """ @@ -329,7 +329,7 @@ python do_checkpkg() { Return new version if success, or else error in "Errxxxx" style """ def check_new_dir(url, curver, d): - pn = bb.data.getVar('PN', d, True) + pn = d.getVar('PN', True) f = tempfile.NamedTemporaryFile(delete=False, prefix="%s-1-" % pn) status = internal_fetch_wget(url, d, f) fhtml = f.read() @@ -372,7 +372,7 @@ python do_checkpkg() { f.close() if status != "ErrHostNoDir" and re.match("Err", status): - logpath = bb.data.getVar('LOG_DIR', d, 1) + logpath = d.getVar('LOG_DIR', 1) os.system("cp %s %s/" % (f.name, logpath)) os.unlink(f.name) return status @@ -388,7 +388,7 @@ python do_checkpkg() { """possible to have no version in pkg name, such as spectrum-fw""" if not re.search("\d+", curname): return pcurver - pn = bb.data.getVar('PN', d, True) + pn = d.getVar('PN', True) f = tempfile.NamedTemporaryFile(delete=False, prefix="%s-2-" % pn) status = internal_fetch_wget(url, d, f) fhtml = f.read() @@ -431,55 +431,55 @@ python do_checkpkg() { f.close() """if host hasn't directory information, no need to save tmp file""" if status != "ErrHostNoDir" and re.match("Err", status): - logpath = bb.data.getVar('LOG_DIR', d, True) + logpath = d.getVar('LOG_DIR', True) os.system("cp %s %s/" % (f.name, logpath)) os.unlink(f.name) return status """first check whether a uri is provided""" - src_uri = bb.data.getVar('SRC_URI', d, True) + src_uri = d.getVar('SRC_URI', True) if not src_uri: return """initialize log files.""" - logpath = bb.data.getVar('LOG_DIR', d, True) + logpath = d.getVar('LOG_DIR', True) bb.utils.mkdirhier(logpath) logfile = os.path.join(logpath, "checkpkg.csv") """generate package information from .bb file""" - pname = bb.data.getVar('PN', d, True) + pname = d.getVar('PN', True) if pname.find("-native") != -1: pnstripped = pname.split("-native") bb.note("Native Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pname.find("-cross") != -1: pnstripped = pname.split("-cross") bb.note("cross Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) if pname.find("-initial") != -1: pnstripped = pname.split("-initial") bb.note("initial Split: %s" % pnstripped) - bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) + bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata) bb.data.update_data(localdata) - pdesc = bb.data.getVar('DESCRIPTION', localdata, True) - pgrp = bb.data.getVar('SECTION', localdata, True) - pversion = bb.data.getVar('PV', localdata, True) - plicense = bb.data.getVar('LICENSE', localdata, True) - psection = bb.data.getVar('SECTION', localdata, True) - phome = bb.data.getVar('HOMEPAGE', localdata, True) - prelease = bb.data.getVar('PR', localdata, True) - ppriority = bb.data.getVar('PRIORITY', localdata, True) - pdepends = bb.data.getVar('DEPENDS', localdata, True) - pbugtracker = bb.data.getVar('BUGTRACKER', localdata, True) - ppe = bb.data.getVar('PE', localdata, True) - psrcuri = bb.data.getVar('SRC_URI', localdata, True) - maintainer = bb.data.getVar('RECIPE_MAINTAINER', localdata, True) + pdesc = localdata.getVar('DESCRIPTION', True) + pgrp = localdata.getVar('SECTION', True) + pversion = localdata.getVar('PV', True) + plicense = localdata.getVar('LICENSE', True) + psection = localdata.getVar('SECTION', True) + phome = localdata.getVar('HOMEPAGE', True) + prelease = localdata.getVar('PR', True) + ppriority = localdata.getVar('PRIORITY', True) + pdepends = localdata.getVar('DEPENDS', True) + pbugtracker = localdata.getVar('BUGTRACKER', True) + ppe = localdata.getVar('PE', True) + psrcuri = localdata.getVar('SRC_URI', True) + maintainer = localdata.getVar('RECIPE_MAINTAINER', True) found = 0 for uri in src_uri.split(): @@ -497,9 +497,9 @@ python do_checkpkg() { (type, host, path, user, pswd, parm) = bb.decodeurl(uri) if type in ['http', 'https', 'ftp']: - pcurver = bb.data.getVar('PV', d, True) + pcurver = d.getVar('PV', True) else: - pcurver = bb.data.getVar("SRCREV", d, True) + pcurver = d.getVar("SRCREV", True) if type in ['http', 'https', 'ftp']: newver = pcurver @@ -639,7 +639,7 @@ python do_checkpkg() { pstatus += ":%s%s" % (host, path) """Read from manual distro tracking fields as alternative""" - pmver = bb.data.getVar("RECIPE_LATEST_VERSION", d, True) + pmver = d.getVar("RECIPE_LATEST_VERSION", True) if not pmver: pmver = "N/A" pmstatus = "ErrNoRecipeData" @@ -688,12 +688,12 @@ python do_distro_check() { localdata = bb.data.createCopy(d) bb.data.update_data(localdata) - tmpdir = bb.data.getVar('TMPDIR', d, True) + tmpdir = d.getVar('TMPDIR', True) distro_check_dir = os.path.join(tmpdir, "distro_check") - logpath = bb.data.getVar('LOG_DIR', d, True) + logpath = d.getVar('LOG_DIR', True) bb.utils.mkdirhier(logpath) result_file = os.path.join(logpath, "distrocheck.csv") - datetime = bb.data.getVar('DATETIME', localdata, True) + datetime = localdata.getVar('DATETIME', True) dc.update_distro_data(distro_check_dir, datetime) # do the comparison @@ -734,12 +734,12 @@ python do_checklicense() { import os import bb import shutil - logpath = bb.data.getVar('LOG_DIR', d, True) + logpath = d.getVar('LOG_DIR', True) bb.utils.mkdirhier(logpath) - pn = bb.data.getVar('PN', d, True) + pn = d.getVar('PN', True) logfile = os.path.join(logpath, "missinglicense.csv") - generic_directory = bb.data.getVar('COMMON_LICENSE_DIR', d, True) - license_types = bb.data.getVar('LICENSE', d, True) + generic_directory = d.getVar('COMMON_LICENSE_DIR', True) + license_types = d.getVar('LICENSE', True) for license_type in ((license_types.replace('+', '').replace('|', '&') .replace('(', '').replace(')', '').replace(';', '') .replace(',', '').replace(" ", "").split("&"))): diff --git a/meta/classes/distutils-base.bbclass b/meta/classes/distutils-base.bbclass index e84b0fcc5a..e7d0bb8071 100644 --- a/meta/classes/distutils-base.bbclass +++ b/meta/classes/distutils-base.bbclass @@ -1,4 +1,4 @@ -DEPENDS += "${@["python-native python", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}" +DEPENDS += "${@["python-native python", ""][(d.getVar('PACKAGES', 1) == '')]}" RDEPENDS_${PN} += "${@['', 'python-core']['${PN}' == '${BPN}']}" inherit distutils-common-base diff --git a/meta/classes/distutils-native-base.bbclass b/meta/classes/distutils-native-base.bbclass index 2703fe0740..47367d796b 100644 --- a/meta/classes/distutils-native-base.bbclass +++ b/meta/classes/distutils-native-base.bbclass @@ -1,3 +1,3 @@ -DEPENDS += "${@["python-native", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}" +DEPENDS += "${@["python-native", ""][(d.getVar('PACKAGES', 1) == '')]}" inherit distutils-common-base diff --git a/meta/classes/gconf.bbclass b/meta/classes/gconf.bbclass index 67986787d7..bffc92ea7a 100644 --- a/meta/classes/gconf.bbclass +++ b/meta/classes/gconf.bbclass @@ -27,8 +27,8 @@ done python populate_packages_append () { import re - packages = bb.data.getVar('PACKAGES', d, 1).split() - pkgdest = bb.data.getVar('PKGDEST', d, 1) + packages = d.getVar('PACKAGES', 1).split() + pkgdest = d.getVar('PKGDEST', 1) for pkg in packages: schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg) @@ -41,15 +41,15 @@ python populate_packages_append () { if schemas != []: bb.note("adding gconf postinst and prerm scripts to %s" % pkg) bb.data.setVar('SCHEMA_FILES', " ".join(schemas), d) - postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) + postinst = d.getVar('pkg_postinst_%s' % pkg, 1) or d.getVar('pkg_postinst', 1) if not postinst: postinst = '#!/bin/sh\n' - postinst += bb.data.getVar('gconf_postinst', d, 1) - bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) - prerm = bb.data.getVar('pkg_prerm_%s' % pkg, d, 1) or bb.data.getVar('pkg_prerm', d, 1) + postinst += d.getVar('gconf_postinst', 1) + d.setVar('pkg_postinst_%s' % pkg, postinst) + prerm = d.getVar('pkg_prerm_%s' % pkg, 1) or d.getVar('pkg_prerm', 1) if not prerm: prerm = '#!/bin/sh\n' - prerm += bb.data.getVar('gconf_prerm', d, 1) - bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d) + prerm += d.getVar('gconf_prerm', 1) + d.setVar('pkg_prerm_%s' % pkg, prerm) } diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass index d0840d59b6..eac3061b0a 100644 --- a/meta/classes/gtk-icon-cache.bbclass +++ b/meta/classes/gtk-icon-cache.bbclass @@ -28,31 +28,31 @@ done } python populate_packages_append () { - packages = bb.data.getVar('PACKAGES', d, 1).split() - pkgdest = bb.data.getVar('PKGDEST', d, 1) + packages = d.getVar('PACKAGES', 1).split() + pkgdest = d.getVar('PKGDEST', 1) for pkg in packages: - icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, bb.data.getVar('datadir', d, 1)) + icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir', 1)) if not os.path.exists(icon_dir): continue bb.note("adding hicolor-icon-theme dependency to %s" % pkg) - rdepends = bb.data.getVar('RDEPENDS_%s' % pkg, d, 1) - rdepends = rdepends + ' ' + bb.data.getVar('MLPREFIX', d) + "hicolor-icon-theme" - bb.data.setVar('RDEPENDS_%s' % pkg, rdepends, d) + rdepends = d.getVar('RDEPENDS_%s' % pkg, 1) + rdepends = rdepends + ' ' + d.getVar('MLPREFIX') + "hicolor-icon-theme" + d.setVar('RDEPENDS_%s' % pkg, rdepends) bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg) - postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) + postinst = d.getVar('pkg_postinst_%s' % pkg, 1) or d.getVar('pkg_postinst', 1) if not postinst: postinst = '#!/bin/sh\n' - postinst += bb.data.getVar('gtk_icon_cache_postinst', d, 1) - bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) + postinst += d.getVar('gtk_icon_cache_postinst', 1) + d.setVar('pkg_postinst_%s' % pkg, postinst) - postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1) + postrm = d.getVar('pkg_postrm_%s' % pkg, 1) or d.getVar('pkg_postrm', 1) if not postrm: postrm = '#!/bin/sh\n' - postrm += bb.data.getVar('gtk_icon_cache_postrm', d, 1) - bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) + postrm += d.getVar('gtk_icon_cache_postrm', 1) + d.setVar('pkg_postrm_%s' % pkg, postrm) } diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass index f8e9d8859b..7e3676af35 100644 --- a/meta/classes/icecc.bbclass +++ b/meta/classes/icecc.bbclass @@ -32,7 +32,7 @@ def icecc_dep_prepend(d): # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not # we need that built is the responsibility of the patch function / class, not # the application. - if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d): + if not d.getVar('INHIBIT_DEFAULT_DEPS'): return "icecc-create-env-native" return "" @@ -54,7 +54,7 @@ def create_path(compilers, bb, d): staging += "-kernel" #check if the icecc path is set by the user - icecc = bb.data.getVar('ICECC_PATH', d) or os.popen("which icecc").read()[:-1] + icecc = d.getVar('ICECC_PATH') or os.popen("which icecc").read()[:-1] # Create the dir if necessary try: @@ -81,7 +81,7 @@ def use_icc(bb,d): package_tmp = bb.data.expand('${PN}', d) system_class_blacklist = [ "none" ] - user_class_blacklist = (bb.data.getVar('ICECC_USER_CLASS_BL', d) or "none").split() + user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL') or "none").split() package_class_blacklist = system_class_blacklist + user_class_blacklist for black in package_class_blacklist: @@ -92,7 +92,7 @@ def use_icc(bb,d): #"system" package blacklist contains a list of packages that can not distribute compile tasks #for one reason or the other system_package_blacklist = [ "uclibc", "glibc", "gcc", "bind", "u-boot", "dhcp-forwarder", "enchant", "connman", "orbit2" ] - user_package_blacklist = (bb.data.getVar('ICECC_USER_PACKAGE_BL', d) or "").split() + user_package_blacklist = (d.getVar('ICECC_USER_PACKAGE_BL') or "").split() package_blacklist = system_package_blacklist + user_package_blacklist for black in package_blacklist: @@ -100,7 +100,7 @@ def use_icc(bb,d): #bb.note(package_tmp, ' found in blacklist, disable icecc') return "no" - if bb.data.getVar('PARALLEL_MAKE', d) == "": + if d.getVar('PARALLEL_MAKE') == "": bb.note(package_tmp, " ", bb.data.expand('${PV}', d), " has empty PARALLEL_MAKE, disable icecc") return "no" @@ -119,8 +119,8 @@ def icc_version(bb, d): if use_icc(bb, d) == "no": return "" - parallel = bb.data.getVar('ICECC_PARALLEL_MAKE', d) or "" - bb.data.setVar("PARALLEL_MAKE", parallel, d) + parallel = d.getVar('ICECC_PARALLEL_MAKE') or "" + d.setVar("PARALLEL_MAKE", parallel) if icc_is_native(bb, d): archive_name = "local-host-env" @@ -130,7 +130,7 @@ def icc_version(bb, d): prefix = bb.data.expand('${HOST_PREFIX}' , d) distro = bb.data.expand('${DISTRO}', d) target_sys = bb.data.expand('${TARGET_SYS}', d) - float = bb.data.getVar('TARGET_FPU', d) or "hard" + float = d.getVar('TARGET_FPU') or "hard" archive_name = prefix + distro + "-" + target_sys + "-" + float if icc_is_kernel(bb, d): archive_name += "-kernel" diff --git a/meta/classes/image-swab.bbclass b/meta/classes/image-swab.bbclass index b939ec4b45..23183b3ec3 100644 --- a/meta/classes/image-swab.bbclass +++ b/meta/classes/image-swab.bbclass @@ -51,13 +51,13 @@ python() { # and cross packages which aren't swabber-native or one of its dependencies # I have ignored them for now... if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('nativesdk', d) and not bb.data.inherits_class('cross', d): - deps = (bb.data.getVarFlag('do_setscene', 'depends', d) or "").split() + deps = (d.getVarFlag('do_setscene', 'depends') or "").split() deps.append('strace-native:do_populate_sysroot') bb.data.setVarFlag('do_setscene', 'depends', " ".join(deps), d) logdir = bb.data.expand("${TRACE_LOGDIR}", d) bb.utils.mkdirhier(logdir) else: - bb.data.setVar('STRACEFUNC', '', d) + d.setVar('STRACEFUNC', '') } STRACEPID = "${@os.getpid()}" diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 14726d2537..4642fa63e2 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -74,17 +74,17 @@ IMAGE_TYPE = ${@base_contains("IMAGE_FSTYPES", "live", "live", "empty", d)} inherit image-${IMAGE_TYPE} python () { - deps = bb.data.getVarFlag('do_rootfs', 'depends', d) or "" - for type in (bb.data.getVar('IMAGE_FSTYPES', d, True) or "").split(): - for dep in ((bb.data.getVar('IMAGE_DEPENDS_%s' % type, d) or "").split() or []): + deps = d.getVarFlag('do_rootfs', 'depends') or "" + for type in (d.getVar('IMAGE_FSTYPES', True) or "").split(): + for dep in ((d.getVar('IMAGE_DEPENDS_%s' % type) or "").split() or []): deps += " %s:do_populate_sysroot" % dep - for dep in (bb.data.getVar('EXTRA_IMAGE