diff options
author | Saul Wold <sgw@linux.intel.com> | 2011-02-08 09:24:12 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-08 17:35:49 +0000 |
commit | 07088f7711e0b53c4fac3685d15d406cf4793602 (patch) | |
tree | 11f3cc19387dee2793e03b8cbf5dfbde47eabc67 /bitbake/lib | |
parent | aa45760702e874977454778659c205b29d1ff049 (diff) | |
download | openembedded-core-07088f7711e0b53c4fac3685d15d406cf4793602.tar.gz openembedded-core-07088f7711e0b53c4fac3685d15d406cf4793602.tar.bz2 openembedded-core-07088f7711e0b53c4fac3685d15d406cf4793602.zip |
bitbake/utils.py: add glob name matching to remove
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/utils.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index a8da672b51..6373912d88 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -594,14 +594,15 @@ def remove(path, recurse=False): """Equivalent to rm -f or rm -rf""" if not path: return - import os, errno, shutil - try: - os.unlink(path) - except OSError as exc: - if recurse and exc.errno == errno.EISDIR: - shutil.rmtree(path) - elif exc.errno != errno.ENOENT: - raise + import os, errno, shutil, glob + for name in glob.glob(path): + try: + os.unlink(name) + except OSError as exc: + if recurse and exc.errno == errno.EISDIR: + shutil.rmtree(name) + elif exc.errno != errno.ENOENT: + raise def prunedir(topdir): # Delete everything reachable from the directory named in 'topdir'. |