]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: utils: Improve remove funciton to handle whitespace
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Feb 2013 22:31:52 +0000 (14:31 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Feb 2013 22:33:05 +0000 (14:33 -0800)
Improve the remove function to better handle cases where path contains
special shell chars like whitespaces, '$', ';' or'\'.

Thanks to Enrico Scholz for the fix.

(Bitbake rev: 617511c9f86cc4ef52457653c8adff582d94bce3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/utils.py

index 8c363dfe20efb3fd8a86738911a16d2bac9702a0..b2f81c8a927ac09b9820e4dbc417aa13916ac9c3 100644 (file)
@@ -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):