diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-11-09 19:13:47 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-11-09 19:13:47 +0900 |
| commit | cabbf1d14b041cfcaa20f1ed7cff4012190016b6 (patch) | |
| tree | b7569994387d64f319517873168237e0d6fdddde | |
| parent | 6d1ae6a864464150c0e7545702e62d15771a3b30 (diff) | |
internal/rosa: zero archive times
This reduces unnecessary rebuilds.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | internal/rosa/state.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go index c236ee6d..e0537b6c 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -20,6 +20,7 @@ import ( "strings" "sync" "sync/atomic" + "time" "unique" "unsafe" @@ -1436,6 +1437,9 @@ func (s *S) setSource(p []byte, version string) { s.DropCaches(s.Arch(), s.Flags()) } +// archiveTime is the hardcoded time written to every header time field. +var archiveTime = time.Unix(0, 0) + // SetSource overrides the hakurei-source package with a cached tarball of fsys. // The resulting IR is curable on the daemon. Must not be used concurrently with // any other method. @@ -1482,6 +1486,7 @@ func (s *S) SetSource(fsys fs.FS) error { if h, err = tar.FileInfoHeader(fi, linkname); err != nil { return err } + h.AccessTime, h.ChangeTime, h.ModTime = archiveTime, archiveTime, archiveTime h.Name = path if err = tw.WriteHeader(h); err != nil { |
