aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-22 15:19:57 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-09 13:27:00 +0000
commit18cc0965741102bccc62dfb32ed7753cdacbadc7 (patch)
treea15e937e9a4944f099ec28bc732811f7df8f5e58 /meta/lib/oe
parent688f7a64917a5ce5cbe12f8e5da4d47e265d240f (diff)
downloadopenembedded-core-contrib-18cc0965741102bccc62dfb32ed7753cdacbadc7.tar.gz
lib/oe/path: add warning comment about oe.path.remove() with wildcarded filenames
Add a warning in the doc comment for oe.path.remove() about using that function on paths that may contain wildcards in the actual file/directory names. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/path.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 804ecd5fea..d4685403c5 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -92,7 +92,14 @@ def copyhardlinktree(src, dst):
copytree(src, dst)
def remove(path, recurse=True):
- """Equivalent to rm -f or rm -rf"""
+ """
+ Equivalent to rm -f or rm -rf
+ NOTE: be careful about passing paths that may contain filenames with
+ wildcards in them (as opposed to passing an actual wildcarded path) -
+ since we use glob.glob() to expand the path. Filenames containing
+ square brackets are particularly problematic since the they may not
+ actually expand to match the original filename.
+ """
for name in glob.glob(path):
try:
os.unlink(name)