def configure(self): self._canonical() cmd = self.opts.subcmd args = self.opts.args cmds = ('list', 'info', 'remove', 'install', 'upgrade', 'summary', 'mark') if cmd not in cmds: logger.critical(_('Invalid groups sub-command, use: %s.'), ", ".join(cmds)) raise dnf.cli.CliError demands = self.cli.demands demands.sack_activation = True if cmd in ('install', 'mark', 'remove', 'upgrade'): demands.root_user = True if cmd == 'remove': demands.allow_erasing = True demands.available_repos = False else: demands.available_repos = True commands.checkEnabledRepo(self.base) if cmd in ('install', 'remove', 'mark', 'info'): if not args: self.cli.optparser.print_help(self) raise dnf.cli.CliError if cmd in ('install', 'upgrade'): commands.checkGPGKey(self.base, self.cli)
def configure(self): demands = self.cli.demands demands.sack_activation = True demands.available_repos = True demands.resolving = True demands.root_user = True commands.checkGPGKey(self.base, self.cli) commands.checkEnabledRepo(self.base, self.opts.packages)
def doCheck(self, basecmd, extcmds): """Verify that conditions are met so that this command can run. These include that the program is being run by the root user, and that there are enabled repositories with gpg keys. :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* """ commands.checkGPGKey(self.base, self.cli) commands.checkEnabledRepo(self.base, extcmds)
def configure(self): """Verify that conditions are met so that this command can run. That there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. """ demands = self.cli.demands demands.sack_activation = True demands.available_repos = True demands.resolving = True demands.root_user = True commands.checkGPGKey(self.base, self.cli) commands.checkEnabledRepo(self.base, self.opts.filenames)
def configure(self): """Verify that conditions are met so that this command can run. These include that there are enabled repositories with gpg keys, and that this command is being run by the root user. """ demands = self.cli.demands demands.sack_activation = True demands.available_repos = True demands.resolving = True demands.root_user = True commands.checkGPGKey(self.base, self.cli) commands.checkEnabledRepo(self.base, self.opts.pkg_specs)
def doCheck(self, basecmd, extcmds): """Verify that conditions are met so that this command can run. The exact conditions checked will vary depending on the subcommand that is being called. :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* """ cmd, extcmds = self._grp_cmd(extcmds) commands.checkEnabledRepo(self.base) if cmd in ("install", "remove", "mark", "info"): _ensure_grp_arg(self.cli, cmd, extcmds) if cmd in ("install", "upgrade"): commands.checkGPGKey(self.base, self.cli) cmds = ("list", "info", "remove", "install", "upgrade", "summary", "mark") if cmd not in cmds: logger.critical(_("Invalid groups sub-command, use: %s."), ", ".join(cmds)) raise dnf.cli.CliError
def doCheck(self, basecmd, extcmds): """Verify that conditions are met so that this command can run. The exact conditions checked will vary depending on the subcommand that is being called. :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* """ cmd, extcmds = self._grp_cmd(extcmds) commands.checkEnabledRepo(self.base) if cmd in ('install', 'remove', 'mark', 'info'): _ensure_grp_arg(self.cli, cmd, extcmds) if cmd in ('install', 'upgrade'): commands.checkGPGKey(self.base, self.cli) cmds = ('list', 'info', 'remove', 'install', 'upgrade', 'summary', 'mark') if cmd not in cmds: logger.critical(_('Invalid groups sub-command, use: %s.'), ", ".join(cmds)) raise dnf.cli.CliError