]> arthur.barton.de Git - bup.git/blobdiff - t/root-status
cirrus: allow failures on macos with python 2
[bup.git] / t / root-status
index 5024ed3afb29b1976c5dfc4635542895adf34ccf..c37806dbd35fede05e66d66485be6b31f9617d48 100755 (executable)
@@ -1,24 +1,24 @@
 #!/bin/sh
 """": # -*-python-*-
-bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
+bup_python="$(dirname "$0")/../config/bin/python" || exit $?
 exec "$bup_python" "$0" ${1+"$@"}
 """
 # end of bup preamble
 
-import sys
+from __future__ import absolute_import, print_function
+import os, sys
 
 if sys.platform.startswith('cygwin'):
-    import ctypes
-    if ctypes.cdll.shell32.IsUserAnAdmin():
-        print 'root'
+    groups = os.getgroups()
+    if 544 in groups or 0 in groups:
+        print('root')
     else:
-        print 'none'
+        print('none')
 else:
-    import os
     if os.environ.get('FAKEROOTKEY'):
-        print 'fake'
+        print('fake')
     else:
         if os.geteuid() == 0:
-            print 'root'
+            print('root')
         else:
-            print 'none'
+            print('none')