summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py17
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):
594 """Equivalent to rm -f or rm -rf""" 594 """Equivalent to rm -f or rm -rf"""
595 if not path: 595 if not path:
596 return 596 return
597 import os, errno, shutil 597 import os, errno, shutil, glob
598 try: 598 for name in glob.glob(path):
599 os.unlink(path) 599 try:
600 except OSError as exc: 600 os.unlink(name)
601 if recurse and exc.errno == errno.EISDIR: 601 except OSError as exc:
602 shutil.rmtree(path) 602 if recurse and exc.errno == errno.EISDIR:
603 elif exc.errno != errno.ENOENT: 603 shutil.rmtree(name)
604 raise 604 elif exc.errno != errno.ENOENT:
605 raise
605 606
606def prunedir(topdir): 607def prunedir(topdir):
607 # Delete everything reachable from the directory named in 'topdir'. 608 # Delete everything reachable from the directory named in 'topdir'.