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.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index e4c12fd1ab..d9f543bc60 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -579,6 +579,17 @@ def build_environment(d):
579 if export: 579 if export:
580 os.environ[var] = bb.data.getVar(var, d, True) or "" 580 os.environ[var] = bb.data.getVar(var, d, True) or ""
581 581
582def remove(path, recurse=False):
583 """Equivalent to rm -f or rm -rf"""
584 import os, errno, shutil
585 try:
586 os.unlink(path)
587 except OSError, exc:
588 if recurse and exc.errno == errno.EISDIR:
589 shutil.rmtree(path)
590 elif exc.errno != errno.ENOENT:
591 raise
592
582def prunedir(topdir): 593def prunedir(topdir):
583 # Delete everything reachable from the directory named in 'topdir'. 594 # Delete everything reachable from the directory named in 'topdir'.
584 # CAUTION: This is dangerous! 595 # CAUTION: This is dangerous!