summaryrefslogtreecommitdiffstats
path: root/lib/bb/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-19 14:31:52 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-19 14:31:56 -0800
commit617511c9f86cc4ef52457653c8adff582d94bce3 (patch)
tree4fa26a1de38b9193d29afcb721d4895daec0a886 /lib/bb/utils.py
parent7e479dc6a574a8f3bd9f24d2ed1c3ceef91f3828 (diff)
downloadbitbake-617511c9f86cc4ef52457653c8adff582d94bce3.tar.gz
utils: Improve remove funciton to handle whitespace
Improve the remove function to better handle cases where path contains special shell chars like whitespaces, '$', ';' or'\'. Thanks to Enrico Scholz for the fix. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r--lib/bb/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 8c363dfe2..b2f81c8a9 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -536,9 +536,9 @@ def remove(path, recurse=False):
if not path:
return
if recurse:
- import subprocess
+ import subprocess, glob
# shutil.rmtree(name) would be ideal but its too slow
- subprocess.call("rm -rf %s" % path, shell=True)
+ subprocess.call(['rm', '-rf'] + glob.glob(path))
return
import os, errno, glob
for name in glob.glob(path):