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

login
register
mail settings
Submitter Richard Purdie
Date Nov. 13, 2012, 2:05 p.m.
Message ID <1352815540.24487.124.camel@ted>
Download mbox | patch
Permalink /patch/38921/
State Accepted
Commit 19ecc264f87a0b94b2340fcb3521024f142dff68
Headers show

Comments

Richard Purdie - Nov. 13, 2012, 2:05 p.m.
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 744cc14..12c9c60 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -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