[oe-commits] [bitbake] 03/03: utils: Use utils.remove() within prunedir()

git at git.openembedded.org git at git.openembedded.org
Sat Dec 8 00:17:36 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 47f359f9b017f8d99d0bb2161ac0dcefcbd915de
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Dec 7 15:39:15 2018 +0000

    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]
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/utils.py | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 13bb5f2..f687ee4 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -708,15 +708,7 @@ def prunedir(topdir):
     # CAUTION:  This is dangerous!
     if _check_unsafe_delete_path(topdir):
         raise Exception('bb.utils.prunedir: called with dangerous path "%s", refusing to delete!' % topdir)
-    for root, dirs, files in os.walk(topdir, topdown = False):
-        for name in files:
-            os.remove(os.path.join(root, name))
-        for name in dirs:
-            if os.path.islink(os.path.join(root, name)):
-                os.remove(os.path.join(root, name))
-            else:
-                os.rmdir(os.path.join(root, name))
-    os.rmdir(topdir)
+    remove(topdir, recurse=True)
 
 #
 # Could also use return re.compile("(%s)" % "|".join(map(re.escape, suffixes))).sub(lambda mo: "", var)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list