diff options
author | Joshua Lock <josh@linux.intel.com> | 2010-08-05 12:57:25 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-12 14:41:31 +0100 |
commit | a5884df90d628b2dc13ac83c9d8045afa6b2a120 (patch) | |
tree | 2edb2464e403438446ed88e38a4415105c1a0f58 /meta/lib/oe | |
parent | dfd7e1f76b30219f3fe30dfe60fcfc6daf6daf9e (diff) | |
download | openembedded-core-a5884df90d628b2dc13ac83c9d8045afa6b2a120.tar.gz openembedded-core-a5884df90d628b2dc13ac83c9d8045afa6b2a120.tar.bz2 openembedded-core-a5884df90d628b2dc13ac83c9d8045afa6b2a120.zip |
lib/oe: support wildcards in path.remove
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/path.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index f58c0138bb..183f205757 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -45,14 +45,15 @@ def format_display(path, metadata): def remove(path): """Equivalent to rm -f or rm -rf""" - import os, errno, shutil - try: - os.unlink(path) - except OSError, exc: - if 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, exc: + if exc.errno == errno.EISDIR: + shutil.rmtree(path) + elif exc.errno != errno.ENOENT: + raise def symlink(source, destination, force=False): """Create a symbolic link""" |