aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/mbf/info.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/mbf/info.go')
-rw-r--r--cmd/mbf/info.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/cmd/mbf/info.go b/cmd/mbf/info.go
index 15357301..4cdea31c 100644
--- a/cmd/mbf/info.go
+++ b/cmd/mbf/info.go
@@ -6,6 +6,7 @@ import (
"io"
"os"
"strings"
+ "unique"
"hakurei.app/internal/pkg"
"hakurei.app/internal/rosa"
@@ -36,16 +37,18 @@ func commandInfo(
}
for i, name := range args {
- if p, ok := rosa.ResolveName(name); !ok {
+ handle := rosa.ArtifactH(unique.Make(name))
+ if meta := rosa.Native().Get(handle); meta == nil {
return fmt.Errorf("unknown artifact %q", name)
} else {
var suffix string
- if version := rosa.Std.Version(p); version != rosa.Unversioned {
+
+ a, version := rosa.Native().MustLoad(rosa.Std, handle)
+ if version != rosa.Unversioned {
suffix += "-" + version
}
mustPrintln("name : " + name + suffix)
- meta := rosa.GetMetadata(p)
mustPrintln("description : " + meta.Description)
if meta.Website != "" {
mustPrintln("website : " +
@@ -54,9 +57,9 @@ func commandInfo(
if len(meta.Dependencies) > 0 {
mustPrint("depends on :")
for _, d := range meta.Dependencies {
- s := rosa.GetMetadata(d).Name
- if version := rosa.Std.Version(d); version != rosa.Unversioned {
- s += "-" + version
+ s := rosa.Native().MustGet(d).Name
+ if _, _version := rosa.Native().Load(rosa.Std, d); _version != rosa.Unversioned {
+ s += "-" + _version
}
mustPrint(" " + s)
}
@@ -68,7 +71,7 @@ func commandInfo(
if r == nil {
var f io.ReadSeekCloser
err = cm.Do(func(cache *pkg.Cache) (err error) {
- f, err = cache.OpenStatus(rosa.Std.Load(p))
+ f, err = cache.OpenStatus(a)
return
})
if err != nil {
@@ -87,7 +90,7 @@ func commandInfo(
}
}
} else if err = cm.Do(func(cache *pkg.Cache) (err error) {
- status, n := r.ArtifactOf(cache.Ident(rosa.Std.Load(p)))
+ status, n := r.ArtifactOf(cache.Ident(a))
if status == nil {
mustPrintln(
statusPrefix + "not in report",