diff --git a/internal/translations/default.pot b/internal/translations/default.pot index 81894c3..c19b262 100644 --- a/internal/translations/default.pot +++ b/internal/translations/default.pot @@ -491,11 +491,11 @@ msgstr "" msgid "Format output using a Go template" msgstr "" -#: search.go:94 search.go:111 +#: search.go:95 search.go:112 msgid "Error parsing format template" msgstr "" -#: search.go:119 +#: search.go:120 msgid "Error executing template" msgstr "" diff --git a/internal/translations/po/ru/default.po b/internal/translations/po/ru/default.po index ba243c1..b58547b 100644 --- a/internal/translations/po/ru/default.po +++ b/internal/translations/po/ru/default.po @@ -514,11 +514,11 @@ msgstr "Иcкать по provides" msgid "Format output using a Go template" msgstr "Формат выходных данных с использованием шаблона Go" -#: search.go:94 search.go:111 +#: search.go:95 search.go:112 msgid "Error parsing format template" msgstr "Ошибка при разборе шаблона" -#: search.go:119 +#: search.go:120 msgid "Error executing template" msgstr "Ошибка при выполнении шаблона" diff --git a/pkg/repos/pull.go b/pkg/repos/pull.go index 2db951d..aabfbbd 100644 --- a/pkg/repos/pull.go +++ b/pkg/repos/pull.go @@ -256,7 +256,6 @@ func (rs *Repos) updatePkg(ctx context.Context, repo types.Repo, runner *interp. return err } resolveOverrides(runner, pkg) - slog.Warn("inserting pkg", "pkg", pkg.BuildDepends) return rs.db.InsertPackage(ctx, *pkg) } diff --git a/search.go b/search.go index 43fb24a..3e874ca 100644 --- a/search.go +++ b/search.go @@ -64,17 +64,18 @@ func SearchCmd() *cli.Command { }, }, Action: func(c *cli.Context) error { - if utils.DropCapsToAlrUser() != nil { - slog.Error(gotext.Get("Can't drop privileges")) - os.Exit(1) + err := utils.ExitIfCantDropCapsToAlrUser() + if err != nil { + return err } ctx := c.Context + cfg := config.New() - err := cfg.Load() + err = cfg.Load() if err != nil { - slog.Error(gotext.Get("Error loading config"), "err", err) - os.Exit(1) + slog.Error(gotext.Get("Error loading config")) + return cli.Exit(err, 1) } db := database.New(cfg) @@ -83,7 +84,7 @@ func SearchCmd() *cli.Command { if err != nil { slog.Error(gotext.Get("Error initialization database"), "err", err) - os.Exit(1) + return cli.Exit(err, 1) } format := c.String("format") @@ -91,8 +92,8 @@ func SearchCmd() *cli.Command { if format != "" { tmpl, err = template.New("format").Parse(format) if err != nil { - slog.Error(gotext.Get("Error parsing format template"), "err", err) - os.Exit(1) + slog.Error(gotext.Get("Error parsing format template")) + return cli.Exit(err, 1) } } @@ -108,16 +109,16 @@ func SearchCmd() *cli.Command { Build(), ) if err != nil { - slog.Error(gotext.Get("Error parsing format template"), "err", err) - os.Exit(1) + slog.Error(gotext.Get("Error parsing format template")) + return cli.Exit(err, 1) } for _, dbPkg := range packages { if tmpl != nil { err = tmpl.Execute(os.Stdout, dbPkg) if err != nil { - slog.Error(gotext.Get("Error executing template"), "err", err) - os.Exit(1) + slog.Error(gotext.Get("Error executing template")) + return cli.Exit(err, 1) } fmt.Println() } else {