diff --git a/lib/entropy/db/skel.py b/lib/entropy/db/skel.py index d0788a0b1..77c6a2c5d 100644 --- a/lib/entropy/db/skel.py +++ b/lib/entropy/db/skel.py @@ -4002,6 +4002,16 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): """ raise NotImplementedError() + def listAllDependencies(self): + """ + List all dependencies available in repository. + + @return: list of tuples of length 2 containing + (dependency id, dependency,) + @rtype: list + """ + raise NotImplementedError() + def listAllSpmUids(self): """ List all Source Package Manager unique package identifiers bindings diff --git a/lib/entropy/db/sql.py b/lib/entropy/db/sql.py index a71053a28..7e8a8f7c5 100644 --- a/lib/entropy/db/sql.py +++ b/lib/entropy/db/sql.py @@ -4639,13 +4639,9 @@ class EntropySQLRepository(EntropyRepositoryBase): cur = self._cursor().execute("SELECT idpackage FROM systempackages") return self._cur2frozenset(cur) - def _listAllDependencies(self): + def listAllDependencies(self): """ - List all dependencies available in repository. - - @return: list of tuples of length 2 containing - (iddependency, dependency, name,) - @rtype: list + Reimplemented from EntropyRepositoryBase. """ cur = self._cursor().execute(""" SELECT iddependency, dependency FROM dependenciesreference @@ -5512,7 +5508,7 @@ class EntropySQLRepository(EntropyRepositoryBase): return rev_deps_data dep_data = {} - for iddep, atom in self._listAllDependencies(): + for iddep, atom in self.listAllDependencies(): if iddep == -1: continue diff --git a/lib/tests/standalone/test_graph.py b/lib/tests/standalone/test_graph.py index b85079b70..e2e038505 100644 --- a/lib/tests/standalone/test_graph.py +++ b/lib/tests/standalone/test_graph.py @@ -9,7 +9,7 @@ if __name__ == "__main__": # test with zillions of atoms repo = cl.open_repository("sabayonlinux.org") - atoms = [x[1] for x in repo._listAllDependencies()] + atoms = [x[1] for x in repo.listAllDependencies()] atoms = [x for x in atoms if not x.startswith("!")] graph = Graph() @@ -63,4 +63,4 @@ if __name__ == "__main__": print "=" * 20 cl.destroy() - raise SystemExit(0) \ No newline at end of file + raise SystemExit(0)