internal/app/paths: do not print messages
All checks were successful
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m32s
Test / Hakurei (push) Successful in 3m36s
Test / Hpkg (push) Successful in 4m30s
Test / Hakurei (race detector) (push) Successful in 5m40s
Test / Sandbox (race detector) (push) Successful in 2m12s
Test / Flake checks (push) Successful in 1m32s
All checks were successful
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m32s
Test / Hakurei (push) Successful in 3m36s
Test / Hpkg (push) Successful in 4m30s
Test / Hakurei (race detector) (push) Successful in 5m40s
Test / Sandbox (race detector) (push) Successful in 2m12s
Test / Flake checks (push) Successful in 1m32s
This change was missed while merging the rest of the logging changes. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
afa1a8043e
commit
71e70b7b5f
@ -210,7 +210,7 @@ func buildCommand(ctx context.Context, msg container.Msg, early *earlyHardeningE
|
|||||||
c.NewCommand("show", "Show live or local app configuration", func(args []string) error {
|
c.NewCommand("show", "Show live or local app configuration", func(args []string) error {
|
||||||
switch len(args) {
|
switch len(args) {
|
||||||
case 0: // system
|
case 0: // system
|
||||||
printShowSystem(msg, os.Stdout, flagShort, flagJSON)
|
printShowSystem(os.Stdout, flagShort, flagJSON)
|
||||||
|
|
||||||
case 1: // instance
|
case 1: // instance
|
||||||
name := args[0]
|
name := args[0]
|
||||||
@ -231,7 +231,7 @@ func buildCommand(ctx context.Context, msg container.Msg, early *earlyHardeningE
|
|||||||
var flagShort bool
|
var flagShort bool
|
||||||
c.NewCommand("ps", "List active instances", func(args []string) error {
|
c.NewCommand("ps", "List active instances", func(args []string) error {
|
||||||
var sc hst.Paths
|
var sc hst.Paths
|
||||||
app.CopyPaths(msg, &sc, new(app.Hsu).MustID())
|
app.CopyPaths(&sc, new(app.Hsu).MustID())
|
||||||
printPs(os.Stdout, time.Now().UTC(), state.NewMulti(msg, sc.RunDirPath.String()), flagShort, flagJSON)
|
printPs(os.Stdout, time.Now().UTC(), state.NewMulti(msg, sc.RunDirPath.String()), flagShort, flagJSON)
|
||||||
return errSuccess
|
return errSuccess
|
||||||
}).Flag(&flagShort, "short", command.BoolFlag(false), "Print instance id")
|
}).Flag(&flagShort, "short", command.BoolFlag(false), "Print instance id")
|
||||||
|
@ -89,7 +89,7 @@ func tryShort(msg container.Msg, name string) (config *hst.Config, entry *state.
|
|||||||
msg.Verbose("argument looks like prefix")
|
msg.Verbose("argument looks like prefix")
|
||||||
|
|
||||||
var sc hst.Paths
|
var sc hst.Paths
|
||||||
app.CopyPaths(msg, &sc, new(app.Hsu).MustID())
|
app.CopyPaths(&sc, new(app.Hsu).MustID())
|
||||||
s := state.NewMulti(msg, sc.RunDirPath.String())
|
s := state.NewMulti(msg, sc.RunDirPath.String())
|
||||||
if entries, err := state.Join(s); err != nil {
|
if entries, err := state.Join(s); err != nil {
|
||||||
log.Printf("cannot join store: %v", err)
|
log.Printf("cannot join store: %v", err)
|
||||||
|
@ -11,19 +11,18 @@ import (
|
|||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"hakurei.app/container"
|
|
||||||
"hakurei.app/hst"
|
"hakurei.app/hst"
|
||||||
"hakurei.app/internal/app"
|
"hakurei.app/internal/app"
|
||||||
"hakurei.app/internal/app/state"
|
"hakurei.app/internal/app/state"
|
||||||
"hakurei.app/system/dbus"
|
"hakurei.app/system/dbus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func printShowSystem(msg container.Msg, output io.Writer, short, flagJSON bool) {
|
func printShowSystem(output io.Writer, short, flagJSON bool) {
|
||||||
t := newPrinter(output)
|
t := newPrinter(output)
|
||||||
defer t.MustFlush()
|
defer t.MustFlush()
|
||||||
|
|
||||||
info := &hst.Info{User: new(app.Hsu).MustID()}
|
info := &hst.Info{User: new(app.Hsu).MustID()}
|
||||||
app.CopyPaths(msg, &info.Paths, info.User)
|
app.CopyPaths(&info.Paths, info.User)
|
||||||
|
|
||||||
if flagJSON {
|
if flagJSON {
|
||||||
printJSON(output, short, info)
|
printJSON(output, short, info)
|
||||||
|
@ -275,7 +275,7 @@ func (k *outcome) finalise(ctx context.Context, msg container.Msg, config *hst.C
|
|||||||
|
|
||||||
// TODO(ophestra): revert this after params to shim
|
// TODO(ophestra): revert this after params to shim
|
||||||
share := &shareHost{seal: k}
|
share := &shareHost{seal: k}
|
||||||
copyPaths(k.syscallDispatcher, msg, &share.sc, hsu.MustIDMsg(msg))
|
copyPaths(k.syscallDispatcher, &share.sc, hsu.MustIDMsg(msg))
|
||||||
msg.Verbosef("process share directory at %q, runtime directory at %q", share.sc.SharePath, share.sc.RunDirPath)
|
msg.Verbosef("process share directory at %q, runtime directory at %q", share.sc.SharePath, share.sc.RunDirPath)
|
||||||
|
|
||||||
var mapuid, mapgid *stringPair[int]
|
var mapuid, mapgid *stringPair[int]
|
||||||
|
@ -8,10 +8,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// CopyPaths populates a [hst.Paths] struct.
|
// CopyPaths populates a [hst.Paths] struct.
|
||||||
func CopyPaths(msg container.Msg, v *hst.Paths, userid int) { copyPaths(direct{}, msg, v, userid) }
|
func CopyPaths(v *hst.Paths, userid int) { copyPaths(direct{}, v, userid) }
|
||||||
|
|
||||||
// copyPaths populates a [hst.Paths] struct.
|
// copyPaths populates a [hst.Paths] struct.
|
||||||
func copyPaths(k syscallDispatcher, msg container.Msg, v *hst.Paths, userid int) {
|
func copyPaths(k syscallDispatcher, v *hst.Paths, userid int) {
|
||||||
const xdgRuntimeDir = "XDG_RUNTIME_DIR"
|
const xdgRuntimeDir = "XDG_RUNTIME_DIR"
|
||||||
|
|
||||||
if tempDir, err := container.NewAbs(k.tempdir()); err != nil {
|
if tempDir, err := container.NewAbs(k.tempdir()); err != nil {
|
||||||
@ -21,7 +21,6 @@ func copyPaths(k syscallDispatcher, msg container.Msg, v *hst.Paths, userid int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
v.SharePath = v.TempDir.Append("hakurei." + strconv.Itoa(userid))
|
v.SharePath = v.TempDir.Append("hakurei." + strconv.Itoa(userid))
|
||||||
msg.Verbosef("process share directory at %q", v.SharePath)
|
|
||||||
|
|
||||||
r, _ := k.lookupEnv(xdgRuntimeDir)
|
r, _ := k.lookupEnv(xdgRuntimeDir)
|
||||||
if a, err := container.NewAbs(r); err != nil {
|
if a, err := container.NewAbs(r); err != nil {
|
||||||
@ -32,5 +31,4 @@ func copyPaths(k syscallDispatcher, msg container.Msg, v *hst.Paths, userid int)
|
|||||||
v.RuntimePath = a
|
v.RuntimePath = a
|
||||||
v.RunDirPath = v.RuntimePath.Append("hakurei")
|
v.RunDirPath = v.RuntimePath.Append("hakurei")
|
||||||
}
|
}
|
||||||
msg.Verbosef("runtime directory at %q", v.RunDirPath)
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user