classes: Standardise whitespace in anonymous python methods and factor out functions for more efficent use by bitbake (as also patched in OE)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@875 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
parent
8174ba4222
commit
8aee6b32a0
|
@ -666,7 +666,8 @@ python read_subpackage_metadata () {
|
||||||
bb.data.setVar(key, sdata[key], d)
|
bb.data.setVar(key, sdata[key], d)
|
||||||
}
|
}
|
||||||
|
|
||||||
python __anonymous () {
|
def base_after_parse_two(d):
|
||||||
|
import bb
|
||||||
import exceptions
|
import exceptions
|
||||||
need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1)
|
need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1)
|
||||||
if need_host:
|
if need_host:
|
||||||
|
@ -691,9 +692,8 @@ python __anonymous () {
|
||||||
use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1)
|
use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1)
|
||||||
if use_nls != None:
|
if use_nls != None:
|
||||||
bb.data.setVar('USE_NLS', use_nls, d)
|
bb.data.setVar('USE_NLS', use_nls, d)
|
||||||
}
|
|
||||||
|
|
||||||
python () {
|
def base_after_parse(d):
|
||||||
import bb, os
|
import bb, os
|
||||||
mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
|
mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
|
||||||
old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
|
old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
|
||||||
|
@ -712,6 +712,10 @@ python () {
|
||||||
#bb.note("overriding PACKAGE_ARCH from %s to %s" % (old_arch, mach_arch))
|
#bb.note("overriding PACKAGE_ARCH from %s to %s" % (old_arch, mach_arch))
|
||||||
bb.data.setVar('PACKAGE_ARCH', mach_arch, d)
|
bb.data.setVar('PACKAGE_ARCH', mach_arch, d)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
python () {
|
||||||
|
base_after_parse_two(d)
|
||||||
|
base_after_parse(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Patch handling
|
# Patch handling
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
python () {
|
def gettext_after_parse(d):
|
||||||
|
import bb
|
||||||
# Remove the NLS bits if USE_NLS is no.
|
# Remove the NLS bits if USE_NLS is no.
|
||||||
if bb.data.getVar('USE_NLS', d, 1) == 'no':
|
if bb.data.getVar('USE_NLS', d, 1) == 'no':
|
||||||
cfg = oe_filter_out('^--(dis|en)able-nls$', bb.data.getVar('EXTRA_OECONF', d, 1) or "", d)
|
cfg = oe_filter_out('^--(dis|en)able-nls$', bb.data.getVar('EXTRA_OECONF', d, 1) or "", d)
|
||||||
|
@ -6,6 +7,9 @@ python () {
|
||||||
depends = bb.data.getVar('DEPENDS', d, 1) or ""
|
depends = bb.data.getVar('DEPENDS', d, 1) or ""
|
||||||
bb.data.setVar('DEPENDS', oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
|
bb.data.setVar('DEPENDS', oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
|
||||||
bb.data.setVar('EXTRA_OECONF', cfg, d)
|
bb.data.setVar('EXTRA_OECONF', cfg, d)
|
||||||
|
|
||||||
|
python () {
|
||||||
|
gettext_after_parse(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
DEPENDS =+ "gettext-native"
|
DEPENDS =+ "gettext-native"
|
||||||
|
|
|
@ -4,7 +4,9 @@ STAGING_KERNEL_DIR = "${STAGING_DIR}/${MULTIMACH_ARCH}-${TARGET_OS}/kernel"
|
||||||
|
|
||||||
# Find any machine specific sub packages and if present, mark the
|
# Find any machine specific sub packages and if present, mark the
|
||||||
# whole package as machine specific for multimachine purposes.
|
# whole package as machine specific for multimachine purposes.
|
||||||
python __anonymous () {
|
|
||||||
|
def multi_machine_after_parse(d):
|
||||||
|
import bb
|
||||||
packages = bb.data.getVar('PACKAGES', d, 1).split()
|
packages = bb.data.getVar('PACKAGES', d, 1).split()
|
||||||
macharch = bb.data.getVar('MACHINE_ARCH', d, 1)
|
macharch = bb.data.getVar('MACHINE_ARCH', d, 1)
|
||||||
multiarch = bb.data.getVar('PACKAGE_ARCH', d, 1)
|
multiarch = bb.data.getVar('PACKAGE_ARCH', d, 1)
|
||||||
|
@ -19,4 +21,7 @@ python __anonymous () {
|
||||||
multiarch = macharch
|
multiarch = macharch
|
||||||
|
|
||||||
bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
|
bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
|
||||||
|
|
||||||
|
python __anonymous () {
|
||||||
|
multi_machine_after_parse(d)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,15 @@ update_alternatives_postrm() {
|
||||||
update-alternatives --remove ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH}
|
update-alternatives --remove ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH}
|
||||||
}
|
}
|
||||||
|
|
||||||
python __anonymous() {
|
def update_alternatives_after_parse(d):
|
||||||
|
import bb
|
||||||
if bb.data.getVar('ALTERNATIVE_NAME', d) == None:
|
if bb.data.getVar('ALTERNATIVE_NAME', d) == None:
|
||||||
raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % bb.data.getVar('FILE', d)
|
raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % bb.data.getVar('FILE', d)
|
||||||
if bb.data.getVar('ALTERNATIVE_PATH', d) == None:
|
if bb.data.getVar('ALTERNATIVE_PATH', d) == None:
|
||||||
raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % bb.data.getVar('FILE', d)
|
raise bb.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % bb.data.getVar('FILE', d)
|
||||||
|
|
||||||
|
python __anonymous() {
|
||||||
|
update_alternatives_after_parse(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
python populate_packages_prepend () {
|
python populate_packages_prepend () {
|
||||||
|
|
|
@ -26,12 +26,16 @@ updatercd_postrm() {
|
||||||
update-rc.d $D ${INITSCRIPT_NAME} remove
|
update-rc.d $D ${INITSCRIPT_NAME} remove
|
||||||
}
|
}
|
||||||
|
|
||||||
python __anonymous() {
|
def update_rc_after_parse(d):
|
||||||
|
import bb
|
||||||
if bb.data.getVar('INITSCRIPT_PACKAGES', d) == None:
|
if bb.data.getVar('INITSCRIPT_PACKAGES', d) == None:
|
||||||
if bb.data.getVar('INITSCRIPT_NAME', d) == None:
|
if bb.data.getVar('INITSCRIPT_NAME', d) == None:
|
||||||
raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % bb.data.getVar('FILE', d)
|
raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % bb.data.getVar('FILE', d)
|
||||||
if bb.data.getVar('INITSCRIPT_PARAMS', d) == None:
|
if bb.data.getVar('INITSCRIPT_PARAMS', d) == None:
|
||||||
raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % bb.data.getVar('FILE', d)
|
raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % bb.data.getVar('FILE', d)
|
||||||
|
|
||||||
|
python __anonymous() {
|
||||||
|
update_rc_after_parse(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
python populate_packages_prepend () {
|
python populate_packages_prepend () {
|
||||||
|
|
Loading…
Reference in New Issue