]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/helpers.py
Merge remote branch 'origin/master' into meta
[bup.git] / lib / bup / helpers.py
index 5b0028364bb29f5b04b2b231f8467172a37b4b0a..0cbb1ebc8bff0397a5114e58d7af2cbfaddb15f5 100644 (file)
@@ -3,6 +3,7 @@
 import sys, os, pwd, subprocess, errno, socket, select, mmap, stat, re, struct
 import heapq, operator, time
 from bup import _version, _helpers
+import bup._helpers as _helpers
 
 # This function should really be in helpers, not in bup.options.  But we
 # want options.py to be standalone so people can include it in other projects.
@@ -182,6 +183,11 @@ def realpath(p):
     return out
 
 
+def detect_fakeroot():
+    "Return True if we appear to be running under fakeroot."
+    return os.getenv("FAKEROOTKEY") != None
+
+
 _username = None
 def username():
     """Get the user's login name."""
@@ -557,6 +563,11 @@ def add_error(e):
     log('%-70s\n' % e)
 
 
+def clear_errors():
+    global saved_errors
+    saved_errors = []
+
+
 def handle_ctrl_c():
     """Replace the default exception handler for KeyboardInterrupt (Ctrl-C).