summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-07 15:39:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-08 17:17:37 +0000
commit888d76d2215565435ce7b0a890e2a7624e213874 (patch)
treecc16fb8404f3e742f10a805ae4e77f580445212b /bitbake/lib
parente74f80433e9a7e7ae7ec1472eb7387301d2dc816 (diff)
downloadpoky-888d76d2215565435ce7b0a890e2a7624e213874.tar.gz
bitbake: utils: Use utils.remove() within prunedir()
We've already tweaked remove() for speed and not to error if it races for deletion. Therefore use this for prunedir() which was starting to show the same bug reports. [YOCTO #13003] (Bitbake rev: 47f359f9b017f8d99d0bb2161ac0dcefcbd915de) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/utils.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 13bb5f2a05..f687ee4127 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -708,15 +708,7 @@ def prunedir(topdir):
708 # CAUTION: This is dangerous! 708 # CAUTION: This is dangerous!
709 if _check_unsafe_delete_path(topdir): 709 if _check_unsafe_delete_path(topdir):
710 raise Exception('bb.utils.prunedir: called with dangerous path "%s", refusing to delete!' % topdir) 710 raise Exception('bb.utils.prunedir: called with dangerous path "%s", refusing to delete!' % topdir)
711 for root, dirs, files in os.walk(topdir, topdown = False): 711 remove(topdir, recurse=True)
712 for name in files:
713 os.remove(os.path.join(root, name))
714 for name in dirs:
715 if os.path.islink(os.path.join(root, name)):
716 os.remove(os.path.join(root, name))
717 else:
718 os.rmdir(os.path.join(root, name))
719 os.rmdir(topdir)
720 712
721# 713#
722# Could also use return re.compile("(%s)" % "|".join(map(re.escape, suffixes))).sub(lambda mo: "", var) 714# Could also use return re.compile("(%s)" % "|".join(map(re.escape, suffixes))).sub(lambda mo: "", var)