aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/oe/path.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/oe/path.py b/lib/oe/path.py
index f58c0138bb..3d64cfaac1 100644
--- a/lib/oe/path.py
+++ b/lib/oe/path.py
@@ -43,13 +43,13 @@ def format_display(path, metadata):
else:
return rel
-def remove(path):
+def remove(path, recurse=True):
"""Equivalent to rm -f or rm -rf"""
import os, errno, shutil
try:
os.unlink(path)
except OSError, exc:
- if exc.errno == errno.EISDIR:
+ if recurse and exc.errno == errno.EISDIR:
shutil.rmtree(path)
elif exc.errno != errno.ENOENT:
raise