internal/pkg: populate substitute status
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 3m8s
Test / Hakurei (push) Successful in 5m36s
Test / ShareFS (push) Successful in 5m37s
Test / Sandbox (race detector) (push) Successful in 6m58s
Test / Hakurei (race detector) (push) Successful in 9m44s
Test / Flake checks (push) Successful in 1m28s
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 3m8s
Test / Hakurei (push) Successful in 5m36s
Test / ShareFS (push) Successful in 5m37s
Test / Sandbox (race detector) (push) Successful in 6m58s
Test / Hakurei (race detector) (push) Successful in 9m44s
Test / Flake checks (push) Successful in 1m28s
These are not created when taking the fast path, but should be inherited from the alternative. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -1995,10 +1995,11 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
|
||||
buf := c.getIdentBuf()
|
||||
sh.Sum(buf[wordSize:wordSize])
|
||||
substitute = unique.Make(ID(buf[wordSize:]))
|
||||
substitutes := Encode(substitute.Value())
|
||||
c.putIdentBuf(buf)
|
||||
alternative = c.base.Append(
|
||||
dirSubstitute,
|
||||
Encode(substitute.Value()),
|
||||
substitutes,
|
||||
)
|
||||
|
||||
if c.flags&CIgnoreSubstitutes == 0 {
|
||||
@@ -2014,6 +2015,17 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
|
||||
dirChecksum,
|
||||
checksums,
|
||||
)
|
||||
if _, err = os.Lstat(c.base.Append(
|
||||
dirStatus,
|
||||
substitutes,
|
||||
).String()); err == nil {
|
||||
err = os.Symlink(substitutes, c.base.Append(
|
||||
dirStatus,
|
||||
ids,
|
||||
).String())
|
||||
} else if errors.Is(err, os.ErrNotExist) {
|
||||
err = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -2023,6 +2035,15 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
|
||||
return
|
||||
}
|
||||
err = ca.Cure(&f)
|
||||
if err == nil && f.status != nil {
|
||||
err = os.Link(c.base.Append(
|
||||
dirStatus,
|
||||
ids,
|
||||
).String(), c.base.Append(
|
||||
dirStatus,
|
||||
substitutes,
|
||||
).String())
|
||||
}
|
||||
c.exitCure(a, curesExempt)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user