package hostfiles import ( "fmt" "strings" ) // EnvItem is the host's env file (.env) among the manifest's // platform items. A release flush stages it beside the wake state so a // relocation's prepared manifest carries it (region HA spec 1 ยง5.6: // always continuous, whatever the setting); the local install restores it // with ReadPlatform. const EnvItem = "host.env" // StagePlatformDelete records that a platform item is gone: the next // Commit publishes a revision without it, at a new sequence, so a reader // of that revision gets os.ErrNotExist from ReadPlatform instead of the // last bytes it published. Deleting an item the manifest does not hold // is a no-op, like StageDelete. func (p *Publisher) StagePlatformDelete(name string) error { if name == "" || strings.ContainsAny(name, "/\x00") { return fmt.Errorf("hostfiles: platform item %q is not a plain name", name) } p.mu.Lock() defer p.mu.Unlock() if _, ok := p.man.Platform[name]; !ok { return nil } p.next++ delete(p.man.Platform, name) p.dirty = true return nil }