Skip to contentSkip to conversation

sstate: Be consistent about sstate-inputdirs/outputdirs ending with '/'

PATCH New Richard Purdie 1 participant 1 message Nov 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sstate: Be consistent about sstate-inputdirs/outputdirs ending with '/'

The manifest file can become corrupted if sstate-inputdirs and sstate-outputdirs don't have matching endings. This patch ensures that even if set incorrectly, the code functions as intended, thereby handling manifest corruption safely.

---

meta/classes/sstate.bbclass +4 -0
index 744cc14..12c9c60 100644
@@ -111,6 +111,10 @@ def sstate_state_fromvars(d, task = None):
 
 def sstate_add(ss, source, dest, d):
     srcbase = os.path.basename(source)
+    if not source.endswith:
+         source = source + "/"
+    if not dest.endswith:
+         dest = dest + "/"
     ss['dirs'].append([srcbase, source, dest])
     return ss