Skip to contentSkip to conversation

ti-sci-fw: Use d.getVar() in DEPENDS expression

PATCH In review Randolph Sapp 2 participants 4 messages Sep 2, 2022 – Sep 9, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ti-sci-fw: Use d.getVar() in DEPENDS expression

Switch the DEPENDS_append expression to use d.getVar() instead of the usual variable expansion to prevent the inline Python command from becoming mangled.

---
 recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb +1 -1
index 3986af47..2a59e896 100644
@@ -9,7 +9,7 @@ DEPENDS_remove_am65xx-hs-evm-k3r5-sr2 = " virtual/bootloader"
 DEPENDS_remove_j7-evm-k3r5 = " virtual/bootloader"
 DEPENDS_remove_j7-hs-evm-k3r5 = " virtual/bootloader"
 DEPENDS_remove_j7-hs-evm-k3r5-sr1-1 = " virtual/bootloader"
-DEPENDS_append = " ${@ '' if '${TI_SECURE_DEV_PKG_K3}' else 'ti-k3-secdev-native' }"
+DEPENDS_append = " ${@ '' if d.getVar('TI_SECURE_DEV_PKG_K3') else 'ti-k3-secdev-native' }"
 
 CLEANBROKEN = "1"
 PR = "${INC_PR}.2"
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Randolph Sapp via lists.yoctoproject.org

Switch the DEPENDS_append expression to use d.getVar() instead of the usual variable expansion to prevent the inline Python command from becoming mangled.

I had originally done it this way (just due to copy/paste from elsewhere), but couldn't think of a case that would cause mangling, do you have an example?

Either way LGTM,

Quoted 29 lines
---
  recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb +1 -2
index 3986af47..2a59e896 100644
@@ -9,7 +9,7 @@ DEPENDS_remove_am65xx-hs-evm-k3r5-sr2 = " virtual/bootloader"
  DEPENDS_remove_j7-evm-k3r5 = " virtual/bootloader"
  DEPENDS_remove_j7-hs-evm-k3r5 = " virtual/bootloader"
  DEPENDS_remove_j7-hs-evm-k3r5-sr1-1 = " virtual/bootloader"
-DEPENDS_append = " ${@ '' if '${TI_SECURE_DEV_PKG_K3}' else 'ti-k3-secdev-native' }"
+DEPENDS_append = " ${@ '' if d.getVar('TI_SECURE_DEV_PKG_K3') else 'ti-k3-secdev-native' }"
 
  CLEANBROKEN = "1"
  PR = "${INC_PR}.2"
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#14991): https://lists.yoctoproject.org/g/meta-ti/message/14991
Mute This Topic: https://lists.yoctoproject.org/mt/93427763/3619733
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 2 lines · Andrew Davis

I had originally done it this way (just due to copy/paste from elsewhere), but couldn't think of a case that would cause mangling, do you have an example?

Ah, sorry. I didn't actually spend the time to see if it was actually mangling from the variable or just Yocto moving away from this notation and python choking on the un-expanded variable.

https://docs.yoctoproject.org/dunfell/ref-manual/migration-2.1.html?highlight=d+getvar#variable-expansion-in-python-functions

#3 lore raw
Quoted 9 lines · Randolph
Quoted 2 lines · Andrew Davis

I had originally done it this way (just due to copy/paste from elsewhere), but couldn't think of a case that would cause mangling, do you have an example?

Ah, sorry. I didn't actually spend the time to see if it was actually mangling from the variable or just Yocto moving away from this notation and python choking on the un-expanded variable.

https://docs.yoctoproject.org/dunfell/ref-manual/migration-2.1.html?highlight=d+getvar#variable-expansion-in-python-functions

I see, well if Yocto is moving away they must be doing it for a good reason, so all good here.

Andrew