From: Michael Tremer Date: Fri, 23 Apr 2021 15:43:18 +0000 (+0000) Subject: builder: Make repolist work X-Git-Tag: 0.9.28~1285^2~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7c714109541cf859990a789ae5256f8cd0fcb68;p=pakfire.git builder: Make repolist work Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/cli.py b/src/pakfire/cli.py index 98c6ffdaf..a09839d62 100644 --- a/src/pakfire/cli.py +++ b/src/pakfire/cli.py @@ -502,6 +502,17 @@ class CliBuilder(Cli): s = pkg.dump(long=ns.verbose) self.ui.message(s) + def handle_repolist(self, ns): + with self.builder(ns) as b: + with b.pakfire as p: + FORMAT = " %-20s %8s %12s %12s " + title = FORMAT % (_("Repository"), _("Enabled"), _("Priority"), _("Packages")) + print(title) + print("=" * len(title)) # spacing line + + for repo in p.repos: + print(FORMAT % (repo.name, repo.enabled, repo.priority, len(repo))) + def handle_shell(self, ns): with self.builder(ns) as b: b.shell(packages=ns.package, install=ns.install)