forked from rosa/hakurei
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -32,10 +32,14 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
|
||||
zero [wordSize]byte
|
||||
buf [len(pkg.ID{}) + wordSize]byte
|
||||
)
|
||||
for i := range PresetEnd {
|
||||
a := Std.Load(PArtifact(i))
|
||||
for _, p := range native.Collect() {
|
||||
a, _ := native.Load(Std, p)
|
||||
meta := native.Get(p)
|
||||
if meta == nil {
|
||||
return errors.New("artifact " + p.String() + " in inconsistent state")
|
||||
}
|
||||
if _, ok := a.(pkg.FileArtifact); ok {
|
||||
msg.Verbosef("skipping file artifact %s", artifactsM[i].Name)
|
||||
msg.Verbosef("skipping file artifact %s", meta.Name)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -44,7 +48,7 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
|
||||
var f *os.File
|
||||
if r, err := c.OpenStatus(a); err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
msg.Verbosef("artifact %s unavailable", artifactsM[i].Name)
|
||||
msg.Verbosef("artifact %s unavailable", meta.Name)
|
||||
continue
|
||||
}
|
||||
return err
|
||||
@@ -52,7 +56,7 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
|
||||
f = r.(*os.File)
|
||||
}
|
||||
|
||||
msg.Verbosef("writing artifact %s...", artifactsM[i].Name)
|
||||
msg.Verbosef("writing artifact %s...", meta.Name)
|
||||
|
||||
var sz int64
|
||||
if fi, err := f.Stat(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user