|
@@ -27,6 +27,7 @@ CHUNK_MASK = 0xffff
|
|
utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})
|
|
utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})
|
|
has_mtime_ns = sys.version >= '3.3'
|
|
has_mtime_ns = sys.version >= '3.3'
|
|
has_lchmod = hasattr(os, 'lchmod')
|
|
has_lchmod = hasattr(os, 'lchmod')
|
|
|
|
+has_lchflags = hasattr(os, 'lchflags')
|
|
|
|
|
|
|
|
|
|
class DownloadPipeline:
|
|
class DownloadPipeline:
|
|
@@ -315,6 +316,12 @@ class Archive:
|
|
os.utime(path, None, ns=(item[b'mtime'], item[b'mtime']), follow_symlinks=False)
|
|
os.utime(path, None, ns=(item[b'mtime'], item[b'mtime']), follow_symlinks=False)
|
|
elif not symlink:
|
|
elif not symlink:
|
|
os.utime(path, (item[b'mtime'] / 10**9, item[b'mtime'] / 10**9))
|
|
os.utime(path, (item[b'mtime'] / 10**9, item[b'mtime'] / 10**9))
|
|
|
|
+ # Only available on OS X and FreeBSD
|
|
|
|
+ if has_lchflags and b'bsdflags' in item:
|
|
|
|
+ try:
|
|
|
|
+ os.lchflags(path, item[b'bsdflags'])
|
|
|
|
+ except OSError:
|
|
|
|
+ pass
|
|
|
|
|
|
def delete(self, stats):
|
|
def delete(self, stats):
|
|
unpacker = msgpack.Unpacker(use_list=False)
|
|
unpacker = msgpack.Unpacker(use_list=False)
|
|
@@ -341,6 +348,8 @@ class Archive:
|
|
xattrs = xattr.get_all(path, follow_symlinks=False)
|
|
xattrs = xattr.get_all(path, follow_symlinks=False)
|
|
if xattrs:
|
|
if xattrs:
|
|
item[b'xattrs'] = StableDict(xattrs)
|
|
item[b'xattrs'] = StableDict(xattrs)
|
|
|
|
+ if has_lchflags and st.st_flags:
|
|
|
|
+ item[b'bsdflags'] = st.st_flags
|
|
return item
|
|
return item
|
|
|
|
|
|
def process_item(self, path, st):
|
|
def process_item(self, path, st):
|