]> code.ossystems Code Review - openembedded-core.git/commitdiff
gen-lockedsig-cache: fix bad destination path joining
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 26 Jan 2016 00:20:24 +0000 (13:20 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 Jan 2016 22:31:10 +0000 (22:31 +0000)
When copying the sstate-cache into the extensible SDK, if the source
path had a trailing / and the destination path did not, there would be a
missing / between the path and the subdirectory name, and you'd end up
with subdirectories like "sstate-cacheCentOS-6.7". There are functions
in os.path for this sort of thing so let's just use them and avoid the
problem.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/gen-lockedsig-cache

index a4e9dede01e251a853d16e093fa4ea73d32c173a..0986a2165152fe358da05cc190fb1f4dedaf7ba6 100755 (executable)
@@ -41,7 +41,7 @@ for f in files:
         # Most likely a temp file, skip it
         print('skipping')
         continue
-    dst = f.replace(sys.argv[2], sys.argv[3])
+    dst = os.path.join(sys.argv[3], os.path.relpath(f, sys.argv[2]))
     destdir = os.path.dirname(dst)
     mkdir(destdir)