Skip to content

Commit 0da729d

Browse files
committed
cascache.py: Support directory mtime in checkout()
1 parent 70fa523 commit 0da729d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/buildstream/_cas/cascache.py

+5
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ def checkout(self, dest, tree, *, can_link=False, _fetch=True):
226226
fullpath = os.path.join(dest, symlinknode.name)
227227
os.symlink(symlinknode.target, fullpath)
228228

229+
node_properties = directory.node_properties
230+
if node_properties.HasField("mtime"):
231+
mtime = utils._parse_protobuf_timestamp(node_properties.mtime)
232+
utils._set_file_mtime(dest, mtime)
233+
229234
# ensure_tree():
230235
#
231236
# Make sure all blobs referenced by the given directory tree are available

0 commit comments

Comments
 (0)