diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index 5e123f0..b9da60b 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -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 { switch len(args) { case 0: // system - printShowSystem(msg, os.Stdout, flagShort, flagJSON) + printShowSystem(os.Stdout, flagShort, flagJSON) case 1: // instance name := args[0] @@ -231,7 +231,7 @@ func buildCommand(ctx context.Context, msg container.Msg, early *earlyHardeningE var flagShort bool c.NewCommand("ps", "List active instances", func(args []string) error { 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) return errSuccess }).Flag(&flagShort, "short", command.BoolFlag(false), "Print instance id") diff --git a/cmd/hakurei/parse.go b/cmd/hakurei/parse.go index 3825ca1..eee7d32 100644 --- a/cmd/hakurei/parse.go +++ b/cmd/hakurei/parse.go @@ -89,7 +89,7 @@ func tryShort(msg container.Msg, name string) (config *hst.Config, entry *state. msg.Verbose("argument looks like prefix") 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()) if entries, err := state.Join(s); err != nil { log.Printf("cannot join store: %v", err) diff --git a/cmd/hakurei/print.go b/cmd/hakurei/print.go index 2c57538..938517b 100644 --- a/cmd/hakurei/print.go +++ b/cmd/hakurei/print.go @@ -11,19 +11,18 @@ import ( "text/tabwriter" "time" - "hakurei.app/container" "hakurei.app/hst" "hakurei.app/internal/app" "hakurei.app/internal/app/state" "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) defer t.MustFlush() info := &hst.Info{User: new(app.Hsu).MustID()} - app.CopyPaths(msg, &info.Paths, info.User) + app.CopyPaths(&info.Paths, info.User) if flagJSON { printJSON(output, short, info) diff --git a/internal/app/finalise.go b/internal/app/finalise.go index 08fab97..708df05 100644 --- a/internal/app/finalise.go +++ b/internal/app/finalise.go @@ -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 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) var mapuid, mapgid *stringPair[int] diff --git a/internal/app/paths.go b/internal/app/paths.go index 442317c..267d0ea 100644 --- a/internal/app/paths.go +++ b/internal/app/paths.go @@ -8,10 +8,10 @@ import ( ) // 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. -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" 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)) - msg.Verbosef("process share directory at %q", v.SharePath) r, _ := k.lookupEnv(xdgRuntimeDir) 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.RunDirPath = v.RuntimePath.Append("hakurei") } - msg.Verbosef("runtime directory at %q", v.RunDirPath) }