summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-22 15:19:58 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-09 13:39:11 +0000
commit3d6c667e5455c2333dedd7a9b5040c51b0ccdd8f (patch)
tree058b08600d098536c90cdaa1a912df935e0b50f2 /meta/classes/sstate.bbclass
parentd008867e45b276e69da43adaed93a668800cccf3 (diff)
downloadpoky-3d6c667e5455c2333dedd7a9b5040c51b0ccdd8f.tar.gz
classes/sstate: handle filenames containing square brackets
If a recipe installs a file or directory whose name contains square brackets [ ] that form a valid glob expression and that file then they won't be correctly removed from the sysroot, because we pass each path in the sstate manifest to our oe.path.remove() function which calls glob.glob() on the path passed into it and the expression won't actually match the original filename. Since we don't expect to put any wildcarded expressions in the sstate manifests, and we already have a try...except around this, we can actually use os.remove() here instead. Similarly, when we pass existing file paths to "grep" looking through the manifests, we don't want those paths to be treated as regexes - so use grep's -F command line switch. Fixes [YOCTO #10836]. (From OE-Core rev: fd8a57861024fc82e15a2a4ec8c20ed0ebb242f6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index a7cd9ec112..755bf590c4 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -213,7 +213,7 @@ def sstate_install(ss, d):
213 break 213 break
214 if realmatch: 214 if realmatch:
215 match.append(f) 215 match.append(f)
216 sstate_search_cmd = "grep -rl '%s' %s --exclude=master.list | sed -e 's:^.*/::' -e 's:\.populate-sysroot::'" % (f, d.expand("${SSTATE_MANIFESTS}")) 216 sstate_search_cmd = "grep -rlF '%s' %s --exclude=master.list | sed -e 's:^.*/::' -e 's:\.populate-sysroot::'" % (f, d.expand("${SSTATE_MANIFESTS}"))
217 search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0] 217 search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
218 if search_output != "": 218 if search_output != "":
219 match.append("Matched in %s" % search_output.rstrip()) 219 match.append("Matched in %s" % search_output.rstrip())
@@ -406,7 +406,7 @@ def sstate_clean_manifest(manifest, d):
406 elif os.path.exists(entry) and len(os.listdir(entry)) == 0: 406 elif os.path.exists(entry) and len(os.listdir(entry)) == 0:
407 os.rmdir(entry[:-1]) 407 os.rmdir(entry[:-1])
408 else: 408 else:
409 oe.path.remove(entry) 409 os.remove(entry)
410 except OSError: 410 except OSError:
411 pass 411 pass
412 412