Bug 10836

Summary: Files with names containing square brackets populated by sstate may not be removed properly
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: coreAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, richard.purdie
Version: 2.2   
Target Milestone: 2.3 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Eggleton 2016-12-21 02:45:45 UTC
I am currently dealing with a recipe which installs a file "[#f1ipping4nn0y1ing].file.NAME--3[$2$$!].mkv" (part of a test). Unfortunately this contains a wildcard specification and in sstate_clean_manifest() we are using oe.path.remove() which uses glob.glob() on whatever is passed to it - and since unlike a stray ? or * the wildcard doesn't actually match the file in the end, so the file never gets removed from the sysroot. Thus if you clean and then run do_populate_sysroot again it gives you the "trying to install files into a shared area when those files already exist" error since the files got left behind.

Normally I would say just delete this file in the recipe, but we're dealing with something coming from npm which means we'd rather have the solution automated. At the moment I'm not sure we expect sstate manifests (where the values we pass to oe.path.remove() come from) actually should contain any wildcards, therefore we may be able to just delete the files with os.unlink() instead of oe.path.remove() (perhaps ignoring ENOENT since we effectively skip missing files at the moment).