Skip to contentSkip to conversation

base: improve do_unpack[cleandirs] logic

PATCH New Ross Burton 1 participant 1 message Apr 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 base: improve do_unpack[cleandirs] logic

If a recipe sets S to ${WORKDIR}/ then the S != WORKDIR test doesn't work as expected. Use os.path.normpath() to normalise the paths so string comparison works.

---
 meta/classes/base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/base.bbclass +1 -1
index bb1f4b75336..d5798f9c48c 100644
@@ -152,7 +152,7 @@ python base_do_fetch() {
 addtask unpack after do_fetch
 do_unpack[dirs] = "${WORKDIR}"
 
-do_unpack[cleandirs] = "${@d.getVar('S') if d.getVar('S') != d.getVar('WORKDIR') else os.path.join('${S}', 'patches')}"
+do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) != os.path.normpath(d.getVar('WORKDIR')) else os.path.join('${S}', 'patches')}"
 
 python base_do_unpack() {
     src_uri = (d.getVar('SRC_URI') or "").split()
Signature · 1 line
2.11.0