Bug 10836 - Files with names containing square brackets populated by sstate may not be removed properly
Summary: Files with names containing square brackets populated by sstate may not be re...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.3 M2
Assignee: Paul Eggleton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-12-21 02:45 UTC by Paul Eggleton
Modified: 2017-01-19 19:57 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).