check = subparsers.add_parser("check", help=_("Check the system for any errors"))
check.set_defaults(func=self.handle_check)
- # check-update
- check_update = subparsers.add_parser("check-update",
- help=_("Check, if there are any updates available"))
- check_update.set_defaults(func=self.handle_check_update)
- check_update.add_argument("--exclude", "-x", nargs="+",
- help=_("Exclude package from update"))
- check_update.add_argument("--allow-archchange", action="store_true",
- help=_("Allow changing the architecture of packages"))
- check_update.add_argument("--allow-downgrade", action="store_true",
- help=_("Allow downgrading of packages"))
- check_update.add_argument("--allow-vendorchange", action="store_true",
- help=_("Allow changing the vendor of packages"))
-
# clean
clean = subparsers.add_parser("clean", help=_("Cleanup all temporary files"))
clean.set_defaults(func=self.handle_clean)
- # downgrade
- downgrade = subparsers.add_parser("downgrade", help=_("Downgrade one or more packages"))
- downgrade.add_argument("package", nargs="*",
- help=_("Give a name of a package to downgrade"))
- downgrade.add_argument("--allow-vendorchange", action="store_true",
- help=_("Allow changing the vendor of packages"))
- downgrade.add_argument("--disallow-archchange", action="store_true",
- help=_("Disallow changing the architecture of packages"))
- downgrade.set_defaults(func=self.handle_downgrade)
-
# execute
execute = subparsers.add_parser("execute",
help=_("Executes a command in the pakfire environment (useful for development)"))
execute.add_argument("command", nargs=argparse.REMAINDER)
execute.set_defaults(func=self.handle_execute)
- # extract
- extract = subparsers.add_parser("extract",
- help=_("Extract a package to a directory"))
- extract.add_argument("package", nargs="+",
- help=_("Give name of the file to extract"))
- extract.add_argument("--target", nargs="?",
- help=_("Target directory where to extract to"))
- extract.set_defaults(func=self.handle_extract)
-
# info
info = subparsers.add_parser("info",
help=_("Print some information about the given package(s)"))
self._execute_transaction(transaction)
- def handle_check_update(self, ns):
- self.handle_update(ns, check=True)
-
- def handle_downgrade(self, ns, **args):
- with self.pakfire(ns) as p:
- p.downgrade(
- self.args.package,
- allow_vendorchange=self.args.allow_vendorchange,
- allow_archchange=not self.args.disallow_archchange,
- **args
- )
-
def handle_install(self, ns):
p = self.pakfire(ns)
p.install(ns.package, include_recommended=not ns.without_recommends)
print(_("Everything okay"))
- def handle_extract(self, ns):
- with self.pakfire(ns) as p:
- p.extract(ns.package, target=ns.target)
class CliClient(Cli):