Ejemplo n.º 1
0
    def _build_repo(self, parser, id_, repofn):
        """Build a repository using the parsed data."""

        repo = dnf.repo.Repo(id_, self.conf)
        try:
            repo._populate(parser, id_, repofn, dnf.conf.PRIO_REPOCONFIG)
        except ValueError as e:
            msg = _("Repository '%s': Error parsing config: %s") % (id_, e)
            raise dnf.exceptions.ConfigError(msg)

        # Ensure that the repo name is set
        repo_name_object = repo._get_option('name')
        if repo_name_object._get_priority() == dnf.conf.PRIO_DEFAULT:
            msg = _("Repository '%s' is missing name in configuration, using id.")
            logger.warning(msg, id_)
        repo.name = ucd(repo.name)
        repo._substitutions.update(self.conf.substitutions)
        repo.cfg = parser

        return repo
Ejemplo n.º 2
0
Archivo: read.py Proyecto: mavit/dnf
    def _build_repo(self, parser, id_, repofn):
        """Build a repository using the parsed data."""

        repo = dnf.repo.Repo(id_, self.conf)
        try:
            repo._populate(parser, id_, repofn, dnf.conf.PRIO_REPOCONFIG)
        except ValueError as e:
            msg = _("Repository '%s': Error parsing config: %s" % (id_, e))
            raise dnf.exceptions.ConfigError(msg)

        # Ensure that the repo name is set
        repo_name_object = repo._get_option('name')
        if repo_name_object._get_priority() == dnf.conf.PRIO_DEFAULT:
            msg = _("Repository '%s' is missing name in configuration, using id.")
            logger.warning(msg, id_)
        repo.name = ucd(repo.name)
        repo._substitutions.update(self.conf.substitutions)
        repo.cfg = parser

        return repo