sandbox: wrap fmsg interface
All checks were successful
Test / Create distribution (push) Successful in 24s
Test / Fortify (push) Successful in 2m27s
Test / Fpkg (push) Successful in 3m36s
Test / Data race detector (push) Successful in 4m16s
Test / Flake checks (push) Successful in 55s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-03-17 02:31:46 +09:00
parent ee10860357
commit 9a1f8e129f
32 changed files with 270 additions and 194 deletions

View File

@@ -25,19 +25,19 @@ type Hardlink struct {
func (l *Hardlink) Type() Enablement { return l.et }
func (l *Hardlink) apply(sys *I) error {
sys.println("linking", l)
return sys.wrapErrSuffix(os.Link(l.src, l.dst),
func (l *Hardlink) apply(*I) error {
msg.Verbose("linking", l)
return wrapErrSuffix(os.Link(l.src, l.dst),
fmt.Sprintf("cannot link %q:", l.dst))
}
func (l *Hardlink) revert(sys *I, ec *Criteria) error {
func (l *Hardlink) revert(_ *I, ec *Criteria) error {
if ec.hasType(l) {
sys.printf("removing hard link %q", l.dst)
return sys.wrapErrSuffix(os.Remove(l.dst),
msg.Verbosef("removing hard link %q", l.dst)
return wrapErrSuffix(os.Remove(l.dst),
fmt.Sprintf("cannot remove hard link %q:", l.dst))
} else {
sys.printf("skipping hard link %q", l.dst)
msg.Verbosef("skipping hard link %q", l.dst)
return nil
}
}