1
0
mirror of https://git.yoctoproject.org/meta-ti synced 2026-06-06 02:42:34 +00:00

meta-ti: cleanup use of d.getVar()

1. drop use of True as second parameter, which is default, to align with master
2. there were instances of incorrectly passing 'd' as second parameter from
previous conversion from bb.data.getVar() usage

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
This commit is contained in:
Denys Dmytriyenko
2018-07-10 07:06:01 +00:00
parent f64a19d3e9
commit a5ecd90543
7 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ PARALLEL_XDC = "--jobs=${BB_NUMBER_THREADS}"
PARALLEL_MAKE = ""
def get_doxygen_support(d):
if d.getVar('TI_PDK_DOXYGEN_SUPPORT', True) == '1':
if d.getVar('TI_PDK_DOXYGEN_SUPPORT') == '1':
return ''
return 'DOXYGEN_SUPPORT=no'
+1 -1
View File
@@ -1,5 +1,5 @@
python __anonymous() {
features = d.getVar("MACHINE_FEATURES", d, 1)
features = d.getVar("MACHINE_FEATURES")
if not features:
return
if "mmip" not in features:
@@ -14,11 +14,11 @@ SRCREV = "c0afab259de59909cfe74c01f3f7fbaa147f94b5"
# There's only hardfp version available
python __anonymous() {
tunes = d.getVar("TUNE_FEATURES", d, 1)
tunes = d.getVar("TUNE_FEATURES")
if not tunes:
return
pkgn = d.getVar("PN", d, 1)
pkgv = d.getVar("PV", d, 1)
pkgn = d.getVar("PN")
pkgv = d.getVar("PV")
if "callconvention-hard" not in tunes:
bb.warn("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
@@ -12,11 +12,11 @@ SRCREV = "358fe42d34a7570896e5d1639869da564ddd0484"
# There's only hardfp version available
python __anonymous() {
tunes = d.getVar("TUNE_FEATURES", d, 1)
tunes = d.getVar("TUNE_FEATURES")
if not tunes:
return
pkgn = d.getVar("PN", d, 1)
pkgv = d.getVar("PV", d, 1)
pkgn = d.getVar("PN")
pkgv = d.getVar("PV")
if "callconvention-hard" not in tunes:
bb.warn("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
+8 -8
View File
@@ -39,13 +39,13 @@ python do_unpack() {
# Initialize with empty string to simplify logic to append to SRC_URI
cmem_dtsi = set([''])
for cmem_machine in (d.getVar('CMEM_MACHINE', True) or '').split():
for cmem_machine in (d.getVar('CMEM_MACHINE') or '').split():
# Create copy of data for additional override
localdata = bb.data.createCopy(d)
localdata.setVar('OVERRIDES', '%s:%s' % (cmem_machine, old_overrides))
bb.data.update_data(localdata)
cmem_dtsi.add(localdata.getVar('CMEM_DTSI', True))
cmem_dtsi.add(localdata.getVar('CMEM_DTSI'))
d.appendVar('SRC_URI', ' file://'.join(cmem_dtsi))
bb.build.exec_func('base_do_unpack', d)
@@ -56,27 +56,27 @@ python do_setup_cmem() {
old_overrides = d.getVar('OVERRIDES', False)
if d.getVar('RESERVE_CMEM', True) is '1':
for cmem_machine in (d.getVar('CMEM_MACHINE', True) or '').split():
if d.getVar('RESERVE_CMEM') is '1':
for cmem_machine in (d.getVar('CMEM_MACHINE') or '').split():
# Create copy of data for additional override
localdata = bb.data.createCopy(d)
localdata.setVar('OVERRIDES', '%s:%s' % (cmem_machine, old_overrides))
bb.data.update_data(localdata)
# Get source directory and dtsi filename
src_dir = localdata.getVar('WORKDIR', True)
src_dtsi = localdata.getVar('CMEM_DTSI', True)
src_dir = localdata.getVar('WORKDIR')
src_dtsi = localdata.getVar('CMEM_DTSI')
# Get destination directory and destination dtsi filename which adds
# the MACHINE prefix.
dst_dir = os.path.join(localdata.getVar('S', True), 'arch/arm/boot/dts')
dst_dir = os.path.join(localdata.getVar('S'), 'arch/arm/boot/dts')
dst_dtsi = localdata.expand('${MACHINE}-${CMEM_DTSI}')
# Copy cmem.dtsi into source tree
shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,dst_dtsi))
# Inject dtsi into each dts in list
for dtb in (localdata.getVar('CMEM_DEVICETREE', True) or '').split():
for dtb in (localdata.getVar('CMEM_DEVICETREE') or '').split():
dts = dtb[:-4] + '.dts'
with open(os.path.join(dst_dir,dts), 'a') as dts_file:
+4 -4
View File
@@ -13,14 +13,14 @@ COMPATIBLE_HOST_class-target = "arm.*-linux"
# For now we only have hardfp version for target class
python __anonymous() {
c = d.getVar("CLASSOVERRIDE", d, 1)
c = d.getVar("CLASSOVERRIDE")
if c == "class-target":
tunes = d.getVar("TUNE_FEATURES", d, 1)
tunes = d.getVar("TUNE_FEATURES")
if not tunes:
return
pkgn = d.getVar("PN", d, 1)
pkgv = d.getVar("PV", d, 1)
pkgn = d.getVar("PN")
pkgv = d.getVar("PV")
if "callconvention-hard" not in tunes:
bb.warn("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
+6 -6
View File
@@ -29,21 +29,21 @@ python ti_bin_do_unpack() {
localdata = bb.data.createCopy(d)
bb.data.update_data(localdata)
binfile = d.getVar('BINFILE', localdata)
binfile = localdata.getVar('BINFILE')
binfile = bb.data.expand(binfile, localdata)
# Change to the working directory
save_cwd = os.getcwd()
workdir = d.getVar('WORKDIR', localdata)
workdir = localdata.getVar('WORKDIR')
workdir = bb.data.expand(workdir, localdata)
os.chdir(workdir)
# Get unpack args
arg_string = d.getVar('TI_BIN_UNPK_ARGS', localdata)
arg_string = localdata.getVar('TI_BIN_UNPK_ARGS')
arg_string = bb.data.expand(arg_string, localdata)
# Get unpack commands
cmd_string = d.getVar('TI_BIN_UNPK_CMDS', localdata)
cmd_string = localdata.getVar('TI_BIN_UNPK_CMDS')
cmd_list = cmd_string.split( ":" )
# Make the InstallJammer binary executable so we can run it
@@ -61,14 +61,14 @@ python ti_bin_do_unpack() {
f = os.popen(filename,'w')
for cmd in cmd_list:
if cmd == "workdir":
wdext = d.getVar('TI_BIN_UNPK_WDEXT', localdata)
wdext = localdata.getVar('TI_BIN_UNPK_WDEXT')
wdext = bb.data.expand(wdext, localdata)
cmd = workdir+wdext
f.write(cmd+'\n');
f.close()
# Expand the tarball that was created if required
tarfile = d.getVar('TARFILE', localdata)
tarfile = localdata.getVar('TARFILE')
if bool(tarfile) == True:
tarfile = bb.data.expand(tarfile, localdata)
tcmd = 'tar x --no-same-owner -f %s -C %s' % (tarfile, workdir)