示例#1
0
文件: group.py 项目: rhn/dnf
    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
        if cmd in ('install', 'remove', 'mark', 'info') and not args:
            self.cli.optparser.print_help(self)
            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 in ('install', 'remove', 'upgrade'):
            demands.resolving = 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', 'upgrade'):
            commands._checkGPGKey(self.base, self.cli)
示例#2
0
    def configure(self):
        self._canonical()

        cmd = self.opts.subcmd
        args = self.opts.args

        if cmd not in self._GROUP_SUBCOMMANDS:
            logger.critical(_('Invalid groups sub-command, use: %s.'),
                            ", ".join(self._GROUP_SUBCOMMANDS))
            raise dnf.cli.CliError
        if cmd in ('install', 'remove', 'mark', 'info') and not args:
            self.cli.optparser.print_help(self)
            raise dnf.cli.CliError

        demands = self.cli.demands
        demands.sack_activation = True
        if cmd in ('install', 'mark', 'remove', 'upgrade'):
            demands.root_user = True
            demands.resolving = True
        if cmd == 'remove':
            demands.allow_erasing = True
            demands.available_repos = False
        else:
            demands.available_repos = True

        if cmd not in ('remove'):
            commands._checkEnabledRepo(self.base)

        if cmd in ('install', 'upgrade'):
            commands._checkGPGKey(self.base, self.cli)
示例#3
0
文件: upgradeto.py 项目: pnemade/dnf
 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)
示例#4
0
文件: swap.py 项目: clayne/dnf
 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.install_spec])
示例#5
0
    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)
        if not self.opts.filenames:
            commands._checkEnabledRepo(self.base)
示例#6
0
文件: install.py 项目: pnemade/dnf
 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)
示例#7
0
 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)
示例#8
0
    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)
示例#9
0
文件: upgrade.py 项目: pnemade/dnf
    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)
示例#10
0
    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)
        if not self.opts.filenames:
            commands._checkEnabledRepo(self.base)
        self.upgrade_minimal = None
        self.all_security = None
示例#11
0
文件: upgrade.py 项目: mavit/dnf
    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)
        if not self.opts.filenames:
            commands._checkEnabledRepo(self.base)
        self.upgrade_minimal = None
        self.all_security = None
示例#12
0
文件: makecache.py 项目: mluscon/dnf
 def configure(self):
     """Verify that conditions are met so that this command can
     run; namely that there is an enabled repository.
     """
     commands._checkEnabledRepo(self.base)
示例#13
0
文件: makecache.py 项目: sshyran/dnf
 def configure(self):
     """Verify that conditions are met so that this command can
     run; namely that there is an enabled repository.
     """
     commands._checkEnabledRepo(self.base)