From cabbf1d14b041cfcaa20f1ed7cff4012190016b6 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 9 Nov 2026 19:13:47 +0900 Subject: internal/rosa: zero archive times This reduces unnecessary rebuilds. Signed-off-by: Ophestra --- internal/rosa/state.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal') 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 { -- cgit v1.3.1