mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 15:32:43 +01:00
* Canonicalise timestamps in the Nix store to 1 (1970-01-01 00:00:01
UTC) rather than 0 (00:00:00). 1 is a better choice because some programs use 0 as a special value. For instance, the Template Toolkit uses a timestamp of 0 to denote the non-existence of a file, so it barfs on files in the Nix store (see template-toolkit-nix-store.patch in Nixpkgs). Similarly, Maya 2008 fails to load script directories with a timestamp of 0 and can't be patched because it's closed source. This will also shut up those "implausibly old time stamp" GNU tar warnings.
This commit is contained in:
parent
f24cf5d303
commit
14bc3ce3d6
3 changed files with 4 additions and 4 deletions
|
|
@ -153,7 +153,7 @@ void canonicalisePathMetaData(const Path & path, bool recurse)
|
|||
if (st.st_mtime != 0) {
|
||||
struct utimbuf utimbuf;
|
||||
utimbuf.actime = st.st_atime;
|
||||
utimbuf.modtime = 0;
|
||||
utimbuf.modtime = 1; /* 1 second into the epoch */
|
||||
if (utime(path.c_str(), &utimbuf) == -1)
|
||||
throw SysError(format("changing modification time of `%1%'") % path);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue