]> arthur.barton.de Git - bup.git/blob - t/root-status
restore: add generative --sparse testing
[bup.git] / t / root-status
1 #!/bin/sh
2 """": # -*-python-*-
3 bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
5 """
6 # end of bup preamble
7
8 import sys
9
10 if sys.platform.startswith('cygwin'):
11     import ctypes
12     if ctypes.cdll.shell32.IsUserAnAdmin():
13         print 'root'
14     else:
15         print 'none'
16 else:
17     import os
18     if os.environ.get('FAKEROOTKEY'):
19         print 'fake'
20     else:
21         if os.geteuid() == 0:
22             print 'root'
23         else:
24             print 'none'