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.
This commit is contained in:
Janne Heß 2023-04-24 11:57:34 +02:00
parent 979d25ee13
commit c22352ca20
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ impl fmt::Display for Generation {
}
fn read_build_time(path: &Path) -> Result<Date> {
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)
}