| |
@@ -81,21 +81,26 @@
|
| |
def _get_dependency_details(pool, transaction):
|
| |
candq = transaction.newpackages()
|
| |
result = {}
|
| |
+ cache = {}
|
| |
for p in candq:
|
| |
pkg_details = {}
|
| |
for dep in _iterate_all_requires(p):
|
| |
- matches = set(s for s in candq if s.matchesdep(solv.SOLVABLE_PROVIDES, dep))
|
| |
- if not matches and str(dep).startswith("/"):
|
| |
- # Append provides by files
|
| |
- # TODO: use Dataiterator for getting filelist
|
| |
- matches = set(s for s in pool.select(str(dep), solv.Selection.SELECTION_FILELIST).solvables() if s in candq)
|
| |
- # It was possible to resolve set, so something is wrong here
|
| |
- assert matches
|
| |
- # While multiple packages providing the same thing is rare, it's
|
| |
- # the kind of duplication we want fedmod to be able to help find.
|
| |
- # So we always return a list here, even though it will normally
|
| |
- # only have one entry in it
|
| |
- pkg_details[str(dep)] = sorted(str(m) for m in matches)
|
| |
+ if dep in cache:
|
| |
+ matches = cache[dep]
|
| |
+ else:
|
| |
+ matches = set(s for s in candq if s.matchesdep(solv.SOLVABLE_PROVIDES, dep))
|
| |
+ if not matches and str(dep).startswith("/"):
|
| |
+ # Append provides by files
|
| |
+ # TODO: use Dataiterator for getting filelist
|
| |
+ matches = set(s for s in pool.select(str(dep), solv.Selection.SELECTION_FILELIST).solvables() if s in candq)
|
| |
+ # It was possible to resolve set, so something is wrong here
|
| |
+ assert matches
|
| |
+ cache[dep] = matches
|
| |
+ # While multiple packages providing the same thing is rare, it's
|
| |
+ # the kind of duplication we want fedmod to be able to help find.
|
| |
+ # So we always return a list here, even though it will normally
|
| |
+ # only have one entry in it
|
| |
+ pkg_details[str(dep)] = sorted(str(m) for m in matches)
|
| |
result[str(p)] = pkg_details
|
| |
|
| |
return result
|
| |
This should be outside the indented block.