1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

meta: remove True option to getVar and getVarFlag calls (again)

* True is default since 2016 and most layers were already updated
  not to pass this parameter where not necessary, e.g. oe-core was
  updated couple times, first in:
  https://git.openembedded.org/openembedded-core/commit/?id=7c552996597faaee2fbee185b250c0ee30ea3b5f

  Updated with the same regexp as later oe-core update:
  https://git.openembedded.org/openembedded-core/commit/?id=9f551d588693328e4d99d33be94f26684eafcaba

  with small modification to replace not only d.getVar, but also data.getVar as in e.g.:
  e.data.getVar('ERR_REPORT_USERNAME', True)

  and for getVarFlag:
  sed -e 's|\(d\.getVarFlag \?\)( \?\([^,()]*, \?[^,()]*\), \?True)|\1(\2)|g' \
      -i $(git grep -E 'getVarFlag ?\( ?([^,()]*), ?([^,()]*), ?True\)' \
          | cut -d':' -f1 \
          | sort -u)

(From OE-Core rev: de7bf6689a19dc614ce4b39c84ffd825bee1b962)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 26c74fd10614582e177437608908eb43688ab510)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit 24a86d0c55ee89ae0dc77975e1d0ee02898d2289)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Martin Jansa
2023-02-01 16:50:38 +01:00
committed by Richard Purdie
parent f8183e4c6f
commit 54d0147307
8 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -440,7 +440,7 @@ python () {
localdata.delVar('DATE') localdata.delVar('DATE')
localdata.delVar('TMPDIR') localdata.delVar('TMPDIR')
localdata.delVar('IMAGE_VERSION_SUFFIX') localdata.delVar('IMAGE_VERSION_SUFFIX')
vardepsexclude = (d.getVarFlag('IMAGE_CMD:' + realt, 'vardepsexclude', True) or '').split() vardepsexclude = (d.getVarFlag('IMAGE_CMD:' + realt, 'vardepsexclude') or '').split()
for dep in vardepsexclude: for dep in vardepsexclude:
localdata.delVar(dep) localdata.delVar(dep)
+1 -1
View File
@@ -229,7 +229,7 @@ def get_deployed_dependencies(d):
deploy = {} deploy = {}
# Get all the dependencies for the current task (rootfs). # Get all the dependencies for the current task (rootfs).
taskdata = d.getVar("BB_TASKDEPDATA", False) taskdata = d.getVar("BB_TASKDEPDATA", False)
pn = d.getVar("PN", True) pn = d.getVar("PN")
depends = list(set([dep[0] for dep depends = list(set([dep[0] for dep
in list(taskdata.values()) in list(taskdata.values())
if not dep[0].endswith("-native") and not dep[0] == pn])) if not dep[0].endswith("-native") and not dep[0] == pn]))
+4 -4
View File
@@ -80,15 +80,15 @@ class DpkgIndexer(Indexer):
return return
oe.utils.multiprocess_launch(create_index, index_cmds, self.d) oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1': if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True)) signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
else: else:
signer = None signer = None
if signer: if signer:
for f in index_sign_files: for f in index_sign_files:
signer.detach_sign(f, signer.detach_sign(f,
self.d.getVar('PACKAGE_FEED_GPG_NAME', True), self.d.getVar('PACKAGE_FEED_GPG_NAME'),
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True), self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
output_suffix="gpg", output_suffix="gpg",
use_sha256=True) use_sha256=True)
+2 -2
View File
@@ -11,7 +11,7 @@ export CXX_FOR_TARGET = "g++"
# mips/rv64 doesn't support -buildmode=pie, so skip the QA checking for mips/riscv32 and its # mips/rv64 doesn't support -buildmode=pie, so skip the QA checking for mips/riscv32 and its
# variants. # variants.
python() { python() {
if 'mips' in d.getVar('TARGET_ARCH',True) or 'riscv32' in d.getVar('TARGET_ARCH',True): if 'mips' in d.getVar('TARGET_ARCH') or 'riscv32' in d.getVar('TARGET_ARCH'):
d.appendVar('INSANE_SKIP:%s' % d.getVar('PN',True), " textrel") d.appendVar('INSANE_SKIP:%s' % d.getVar('PN'), " textrel")
} }
+1 -1
View File
@@ -109,7 +109,7 @@ def llvm_features_from_target_fpu(d):
# TARGET_FPU can be hard or soft. +soft-float tell llvm to use soft float # TARGET_FPU can be hard or soft. +soft-float tell llvm to use soft float
# ABI. There is no option for hard. # ABI. There is no option for hard.
fpu = d.getVar('TARGET_FPU', True) fpu = d.getVar('TARGET_FPU')
return ["+soft-float"] if fpu == "soft" else [] return ["+soft-float"] if fpu == "soft" else []
def llvm_features(d): def llvm_features(d):
+10 -10
View File
@@ -79,7 +79,7 @@ python do_configure() {
config = configparser.RawConfigParser() config = configparser.RawConfigParser()
# [target.ARCH-poky-linux] # [target.ARCH-poky-linux]
target_section = "target.{}".format(d.getVar('TARGET_SYS', True)) target_section = "target.{}".format(d.getVar('TARGET_SYS'))
config.add_section(target_section) config.add_section(target_section)
llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}") llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}")
@@ -90,7 +90,7 @@ python do_configure() {
# If we don't do this rust-native will compile it's own llvm for BUILD. # If we don't do this rust-native will compile it's own llvm for BUILD.
# [target.${BUILD_ARCH}-unknown-linux-gnu] # [target.${BUILD_ARCH}-unknown-linux-gnu]
target_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) target_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS'))
config.add_section(target_section) config.add_section(target_section)
config.set(target_section, "llvm-config", e(llvm_config)) config.set(target_section, "llvm-config", e(llvm_config))
@@ -124,26 +124,26 @@ python do_configure() {
config.set("build", "vendor", e(True)) config.set("build", "vendor", e(True))
if not "targets" in locals(): if not "targets" in locals():
targets = [d.getVar("TARGET_SYS", True)] targets = [d.getVar("TARGET_SYS")]
config.set("build", "target", e(targets)) config.set("build", "target", e(targets))
if not "hosts" in locals(): if not "hosts" in locals():
hosts = [d.getVar("HOST_SYS", True)] hosts = [d.getVar("HOST_SYS")]
config.set("build", "host", e(hosts)) config.set("build", "host", e(hosts))
# We can't use BUILD_SYS since that is something the rust snapshot knows # We can't use BUILD_SYS since that is something the rust snapshot knows
# nothing about when trying to build some stage0 tools (like fabricate) # nothing about when trying to build some stage0 tools (like fabricate)
config.set("build", "build", e(d.getVar("SNAPSHOT_BUILD_SYS", True))) config.set("build", "build", e(d.getVar("SNAPSHOT_BUILD_SYS")))
# [install] # [install]
config.add_section("install") config.add_section("install")
# ./x.py install doesn't have any notion of "destdir" # ./x.py install doesn't have any notion of "destdir"
# but we can prepend ${D} to all the directories instead # but we can prepend ${D} to all the directories instead
config.set("install", "prefix", e(d.getVar("D", True) + d.getVar("prefix", True))) config.set("install", "prefix", e(d.getVar("D") + d.getVar("prefix")))
config.set("install", "bindir", e(d.getVar("D", True) + d.getVar("bindir", True))) config.set("install", "bindir", e(d.getVar("D") + d.getVar("bindir")))
config.set("install", "libdir", e(d.getVar("D", True) + d.getVar("libdir", True))) config.set("install", "libdir", e(d.getVar("D") + d.getVar("libdir")))
config.set("install", "datadir", e(d.getVar("D", True) + d.getVar("datadir", True))) config.set("install", "datadir", e(d.getVar("D") + d.getVar("datadir")))
config.set("install", "mandir", e(d.getVar("D", True) + d.getVar("mandir", True))) config.set("install", "mandir", e(d.getVar("D") + d.getVar("mandir")))
with open("config.toml", "w") as f: with open("config.toml", "w") as f:
f.write('changelog-seen = 2\n\n') f.write('changelog-seen = 2\n\n')
+1 -1
View File
@@ -392,7 +392,7 @@ def export_manifest_info(args):
for key in rd.getVarFlags('PACKAGECONFIG').keys(): for key in rd.getVarFlags('PACKAGECONFIG').keys():
if key == 'doc': if key == 'doc':
continue continue
rvalues[pn]['packageconfig_opts'][key] = rd.getVarFlag('PACKAGECONFIG', key, True) rvalues[pn]['packageconfig_opts'][key] = rd.getVarFlag('PACKAGECONFIG', key)
if config['patches'] == 'yes': if config['patches'] == 'yes':
patches = oe.recipeutils.get_recipe_patches(rd) patches = oe.recipeutils.get_recipe_patches(rd)
+1 -1
View File
@@ -43,7 +43,7 @@ def menuconfig(args, config, basepath, workspace):
return 1 return 1
check_workspace_recipe(workspace, args.component) check_workspace_recipe(workspace, args.component)
pn = rd.getVar('PN', True) pn = rd.getVar('PN')
if not rd.getVarFlag('do_menuconfig','task'): if not rd.getVarFlag('do_menuconfig','task'):
raise DevtoolError("This recipe does not support menuconfig option") raise DevtoolError("This recipe does not support menuconfig option")