Ejemplo n.º 1
0
    def __init__(self, *repo_dirs, **kwargs):
        # super-namespace for all packages in the RepoPath
        self.super_namespace = kwargs.get('namespace', repo_namespace)

        self.repos = []
        self.by_namespace = NamespaceTrie()
        self.by_path = {}

        self._all_package_names = None
        self._provider_index = None

        # If repo_dirs is empty, just use the configuration
        if not repo_dirs:
            import spack.config
            repo_dirs = spack.config.get_config('repos')
            if not repo_dirs:
                raise NoRepoConfiguredError(
                    "Spack configuration contains no package repositories.")

        # Add each repo to this path.
        for root in repo_dirs:
            try:
                repo = Repo(root, self.super_namespace)
                self.put_last(repo)
            except RepoError as e:
                tty.warn("Failed to initialize repository at '%s'." % root,
                         e.message,
                         "To remove the bad repository, run this command:",
                         "    spack repo rm %s" % root)
Ejemplo n.º 2
0
    def __init__(self, *repos):
        self.repos = []
        self.by_namespace = NamespaceTrie()

        self._all_package_names = None
        self._provider_index = None
        self._patch_index = None

        # Add each repo to this path.
        for repo in repos:
            try:
                if isinstance(repo, string_types):
                    repo = Repo(repo)
                self.put_last(repo)
            except RepoError as e:
                tty.warn("Failed to initialize repository: '%s'." % repo,
                         e.message,
                         "To remove the bad repository, run this command:",
                         "    spack repo rm %s" % repo)
Ejemplo n.º 3
0
 def setUp(self):
     self.trie = NamespaceTrie()