2
0
Marian Beermann 9 жил өмнө
parent
commit
70c2d69799
1 өөрчлөгдсөн 17 нэмэгдсэн , 14 устгасан
  1. 17 14
      borg/xattr.py

+ 17 - 14
borg/xattr.py

@@ -53,20 +53,23 @@ if libc_name is None:
 # the 'test_extract_capabilities' test, but also allows xattrs to work with fakeroot on Linux in normal use.
 # TODO: Check whether fakeroot supports xattrs on all platforms supported below.
 # TODO: If that's the case then we can make Borg fakeroot-xattr-compatible on these as well.
-XATTR_FAKEROOT = False
-if sys.platform.startswith('linux'):
-    LD_PRELOAD = os.environ.get('LD_PRELOAD', '')
-    preloads = re.split("[ :]", LD_PRELOAD)
-    for preload in preloads:
-        if preload.startswith("libfakeroot"):
-            fakeroot_version = LooseVersion(subprocess.check_output(['fakeroot', '-v']).decode('ascii').split()[-1])
-            if fakeroot_version >= LooseVersion("1.20.2"):
-                # 1.20.2 has been confirmed to have xattr support
-                # 1.18.2 has been confirmed not to have xattr support
-                # Versions in-between are unknown
-                libc_name = preload
-                XATTR_FAKEROOT = True
-            break
+try:
+    XATTR_FAKEROOT = False
+    if sys.platform.startswith('linux'):
+        LD_PRELOAD = os.environ.get('LD_PRELOAD', '')
+        preloads = re.split("[ :]", LD_PRELOAD)
+        for preload in preloads:
+            if preload.startswith("libfakeroot"):
+                fakeroot_version = LooseVersion(subprocess.check_output(['fakeroot', '-v']).decode('ascii').split()[-1])
+                if fakeroot_version >= LooseVersion("1.20.2"):
+                    # 1.20.2 has been confirmed to have xattr support
+                    # 1.18.2 has been confirmed not to have xattr support
+                    # Versions in-between are unknown
+                    libc_name = preload
+                    XATTR_FAKEROOT = True
+                break
+except:
+    pass
 
 try:
     libc = CDLL(libc_name, use_errno=True)