From c22352ca2066fe6a56d74691b0f44ca10891a4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 24 Apr 2023 11:57:34 +0200 Subject: [PATCH] tool: Use mtime of the symlink rather than the target When using the target, this will always result in a timestamp from 1970 because the symlink points to the store. --- rust/tool/src/generation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/tool/src/generation.rs b/rust/tool/src/generation.rs index bffddef..d5c5b5e 100644 --- a/rust/tool/src/generation.rs +++ b/rust/tool/src/generation.rs @@ -96,7 +96,7 @@ impl fmt::Display for Generation { } fn read_build_time(path: &Path) -> Result { - let build_time = time::OffsetDateTime::from_unix_timestamp(fs::metadata(path)?.mtime())?.date(); + let build_time = time::OffsetDateTime::from_unix_timestamp(fs::symlink_metadata(path)?.mtime())?.date(); Ok(build_time) }