Skip to contentSkip to conversation

ti-pdk-fetch.bbclass: Do not emit trailing slash during S forming

PATCH Superseded Khem Raj 2 participants 6 messages Oct 13, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 ti-pdk-fetch.bbclass: Do not emit trailing slash during S forming

latest OE-core does not promote using trailing slash to make pseudo's life easier

---
 classes/ti-pdk-fetch.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
classes/ti-pdk-fetch.bbclass +2 -2
index 0c9879be..4261e86d 100644
@@ -9,13 +9,13 @@ PV = "${TI_PDK_VERSION}"
 PE = "2"
 
 TI_PDK_COMP ?= ""
-TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}"
+TI_PDK_COMP_PATH = "/${@'${TI_PDK_COMP}'.replace('.','/')}"
 
 TI_PDK_SOURCE_PN = "ti-pdk-source"
 TI_PDK_SOURCE_WORKDIR = "${TMPDIR}/work-shared/ti-pdk-${PV}"
 TI_PDK_SOURCE = "${TI_PDK_SOURCE_WORKDIR}/git"
 
-S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}"
+S = "${WORKDIR}/git${TI_PDK_COMP_PATH}"
 
 # Hard-link only required sources from PDK
 python do_unpack_append() {
Signature · 1 line
2.28.0
author
#1 lore raw

PATCH 2/2 ti-rtos-firmware: Remove trailing slash from S

---
 recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb +1 -1
index 2dfae1ec..2bbdd018 100644
@@ -51,7 +51,7 @@ CORESDK_RTOS_FILE_PREFIX ?= ""
 CORESDK_RTOS_FILE_SUFFIX ?= ""
 
 # Common code below
-S = "${WORKDIR}/lib/"
+S = "${WORKDIR}/lib"
 
 PV = "${CORESDK_RTOS_VERSION_DOT}"
 
Signature · 1 line
2.28.0
Reviewed-by on v1 2/2
#2 lore raw

Re: [meta-ti] [PATCH 2/2] ti-rtos-firmware: Remove trailing slash from S

Quoted 1 line · Khem Raj
Quoted 24 lines
---
 recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb +1 -1
index 2dfae1ec..2bbdd018 100644
@@ -51,7 +51,7 @@ CORESDK_RTOS_FILE_PREFIX ?= ""
 CORESDK_RTOS_FILE_SUFFIX ?= ""
 
 # Common code below
-S = "${WORKDIR}/lib/"
+S = "${WORKDIR}/lib"
 
 PV = "${CORESDK_RTOS_VERSION_DOT}"
 
Signature · 1 line
2.28.0
#3 lore raw
In reply to Khem Raj
Quoted 13 lines · Khem Raj

latest OE-core does not promote using trailing slash to make pseudo's life easier

---
 classes/ti-pdk-fetch.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
classes/ti-pdk-fetch.bbclass +0 -0
index 0c9879be..4261e86d 100644

classes/ti-pdk-fetch.bbclass PV = "${TI_PDK_VERSION}" · line 12

Quoted 5 lines
classes/ti-pdk-fetch.bbclass +1 -1
@@ -9,13 +9,13 @@ PV = "${TI_PDK_VERSION}"
 PE = "2"
 
 TI_PDK_COMP ?= ""
-TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}"
+TI_PDK_COMP_PATH = "/${@'${TI_PDK_COMP}'.replace('.','/')}"

This one I don't understand - even when TI_PDK_COMP is empty, TI_PDK_COMP_PATH will have a trailing slash, hence S below will have it too...

Moreover, below in this class there's this line:

src = os.path.join(d.getVar('TI_PDK_SOURCE'),'packages',d.getVar('TI_PDK_COMP_PATH'))

If TI_PDK_COMP_PATH starts with a leading slash, os.path.join treats it as absolute and the resulting "src" var will be completely wrong.

So, I believe this change is incorrect.

Quoted 16 lines
classes/ti-pdk-fetch.bbclass +1 -1
 TI_PDK_SOURCE_PN = "ti-pdk-source"
 TI_PDK_SOURCE_WORKDIR = "${TMPDIR}/work-shared/ti-pdk-${PV}"
 TI_PDK_SOURCE = "${TI_PDK_SOURCE_WORKDIR}/git"
 
-S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}"
+S = "${WORKDIR}/git${TI_PDK_COMP_PATH}"
 
 # Hard-link only required sources from PDK
 python do_unpack_append() {
Signature · 1 line
2.28.0
author
#4 lore raw
Quoted 16 lines · Denys Dmytriyenko
Quoted 15 lines · Khem Raj

latest OE-core does not promote using trailing slash to make pseudo's life easier

---
 classes/ti-pdk-fetch.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
classes/ti-pdk-fetch.bbclass +0 -0
index 0c9879be..4261e86d 100644
@@ -9,13 +9,13 @@ PV = "${TI_PDK_VERSION}"
 PE = "2"
 
Quoted 7 lines

classes/ti-pdk-fetch.bbclass PV = "${TI_PDK_VERSION}" · line 12

Quoted 3 lines
classes/ti-pdk-fetch.bbclass +1 -1
 TI_PDK_COMP ?= ""
-TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}"
+TI_PDK_COMP_PATH = "/${@'${TI_PDK_COMP}'.replace('.','/')}"

This one I don't understand - even when TI_PDK_COMP is empty, TI_PDK_COMP_PATH will have a trailing slash, hence S below will have it too...

Right I think I was thinking of ensuring that we can make conditional to have the slash always and then remove it from S which is missing

I guess it needs to be solved differently

Quoted 8 lines

Moreover, below in this class there's this line:

src = os.path.join(d.getVar('TI_PDK_SOURCE'),'packages',d.getVar('TI_PDK_COMP_PATH'))

If TI_PDK_COMP_PATH starts with a leading slash, os.path.join treats it as absolute and the resulting "src" var will be completely wrong.

This is not going to be problem it will just use // in worst case

Quoted 22 lines

So, I believe this change is incorrect.

Quoted 16 lines
classes/ti-pdk-fetch.bbclass +1 -2
 TI_PDK_SOURCE_PN = "ti-pdk-source"
 TI_PDK_SOURCE_WORKDIR = "${TMPDIR}/work-shared/ti-pdk-${PV}"
 TI_PDK_SOURCE = "${TI_PDK_SOURCE_WORKDIR}/git"
 
-S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}"
+S = "${WORKDIR}/git${TI_PDK_COMP_PATH}"
 
 # Hard-link only required sources from PDK
 python do_unpack_append() {
--

2.28.0

#5 lore raw
Quoted 36 lines · Khem Raj
Quoted 16 lines · Denys Dmytriyenko
Quoted 15 lines · Khem Raj

latest OE-core does not promote using trailing slash to make pseudo's life easier

---
 classes/ti-pdk-fetch.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
classes/ti-pdk-fetch.bbclass +0 -0
index 0c9879be..4261e86d 100644
@@ -9,13 +9,13 @@ PV = "${TI_PDK_VERSION}"
 PE = "2"
 
Quoted 7 lines

classes/ti-pdk-fetch.bbclass PV = "${TI_PDK_VERSION}" · line 12

Quoted 3 lines
classes/ti-pdk-fetch.bbclass +1 -1
 TI_PDK_COMP ?= ""
-TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}"
+TI_PDK_COMP_PATH = "/${@'${TI_PDK_COMP}'.replace('.','/')}"

This one I don't understand - even when TI_PDK_COMP is empty, TI_PDK_COMP_PATH will have a trailing slash, hence S below will have it too...

Right I think I was thinking of ensuring that we can make conditional to have the slash always and then remove it from S which is missing

I guess it needs to be solved differently

Quoted 3 lines

Moreover, below in this class there's this line:

Quoted 8 lines
Quoted 5 lines

src = os.path.join(d.getVar('TI_PDK_SOURCE'),'packages',d.getVar('TI_PDK_COMP_PATH'))

If TI_PDK_COMP_PATH starts with a leading slash, os.path.join treats it as absolute and the resulting "src" var will be completely wrong.

This is not going to be problem it will just use // in worst case

Nope, I tested - it should combine $TI_PDK_SOURCE/packages/$TI_PDK_COMP_PATH

Quoted 1 line
Quoted 1 line

classes/ti-pdk-fetch.bbclass PV = "${TI_PDK_VERSION}" · line 13

Quoted 1 line
classes/ti-pdk-fetch.bbclass +0 -0
 print(os.path.join('a','b','c'))

a/b/c

Quoted 1 line
Quoted 1 line

classes/ti-pdk-fetch.bbclass PV = "${TI_PDK_VERSION}" · line 14

Quoted 1 line
classes/ti-pdk-fetch.bbclass +0 -0
 print(os.path.join('a','b','/c'))

/c

So, if TI_PDK_COMP_PATH starts with slash, it becomes absolute and the final src path will be wrong.

Quoted 21 lines
Quoted 21 lines

So, I believe this change is incorrect.

Quoted 16 lines
classes/ti-pdk-fetch.bbclass +1 -1
 TI_PDK_SOURCE_PN = "ti-pdk-source"
 TI_PDK_SOURCE_WORKDIR = "${TMPDIR}/work-shared/ti-pdk-${PV}"
 TI_PDK_SOURCE = "${TI_PDK_SOURCE_WORKDIR}/git"
 
-S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}"
+S = "${WORKDIR}/git${TI_PDK_COMP_PATH}"
 
 # Hard-link only required sources from PDK

python do_unpack_append() {
--
2.28.0