address review comments

This commit is contained in:
Gregory Becker 2023-03-24 16:00:28 -07:00
parent 553a9036eb
commit a30b07dd36
3 changed files with 14 additions and 2 deletions

View File

@ -2706,7 +2706,7 @@
], ],
"clang" : [ "clang" : [
{ {
"versions": "9.0:12.99", "versions": "9.0:12.0",
"flags" : "-march=armv8.4-a" "flags" : "-march=armv8.4-a"
}, },
{ {

View File

@ -468,6 +468,18 @@ def from_dict(base_path, d):
@property @property
def _current_root(self): def _current_root(self):
"""
Return the directory in which the view is currently implemented.
If the view is using renameat2 for atomic updates, self.root is a directory and the root
of the underlying implementation is the same as self.root.
If the view us using symlinks for atomic updates, self.root is a link and we read the link
to find the root of the underlying implementation of the view.
If self.root does not exist or is a regular file, there is no current implementation of the
view on the filesystem.
"""
if not os.path.islink(self.root): if not os.path.islink(self.root):
if os.path.isdir(self.root): if os.path.isdir(self.root):
return self.root return self.root

View File

@ -19,7 +19,7 @@
# python links against libc, so we can treat this as a libc handle # python links against libc, so we can treat this as a libc handle
# we could also use CDLL("libc.so.6") but this is (irrelevantly) more future proof # we could also use CDLL("libc.so.6") but this is (irrelevantly) more future proof
libc = ctypes.CDLL(None) libc = ctypes.CDLL(None)
except BaseException: except OSError:
pass pass
renameat2 = getattr(libc, "renameat2", None) renameat2 = getattr(libc, "renameat2", None)