diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-12-22 15:19:57 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-09 13:39:11 +0000 |
commit | fff7563799f7ea049c290fc04484f96b69a744ca (patch) | |
tree | 8ca2acea7076e2bd12bc5f073f00ab0bdd6953e9 /meta | |
parent | 022a8b58c862a1db68c2dcddc908317e5d61d92e (diff) | |
download | poky-fff7563799f7ea049c290fc04484f96b69a744ca.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.
(From OE-Core rev: 18cc0965741102bccc62dfb32ed7753cdacbadc7)
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')
-rw-r--r-- | meta/lib/oe/path.py | 9 |
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): | |||
92 | copytree(src, dst) | 92 | copytree(src, dst) |
93 | 93 | ||
94 | def remove(path, recurse=True): | 94 | def remove(path, recurse=True): |
95 | """Equivalent to rm -f or rm -rf""" | 95 | """ |
96 | Equivalent to rm -f or rm -rf | ||
97 | NOTE: be careful about passing paths that may contain filenames with | ||
98 | wildcards in them (as opposed to passing an actual wildcarded path) - | ||
99 | since we use glob.glob() to expand the path. Filenames containing | ||
100 | square brackets are particularly problematic since the they may not | ||
101 | actually expand to match the original filename. | ||
102 | """ | ||
96 | for name in glob.glob(path): | 103 | for name in glob.glob(path): |
97 | try: | 104 | try: |
98 | os.unlink(name) | 105 | os.unlink(name) |