#76 add mapping package/module for dependencies
Merged 5 years ago by nphilipp. Opened 5 years ago by karsten.

file modified
+10 -2
@@ -100,12 +100,13 @@ 

  

      return result

  

- def print_transaction(details):

+ def print_transaction(details, pool):

      tb = smartcols.Table()

      tb.title = "DEPENDENCY INFORMATION"

      cl = tb.new_column("INFO")

      cl.tree = True

      cl_match = tb.new_column("MATCH")

+     cl_repo = tb.new_column("REPO")

      for p in sorted(details):

          ln = tb.new_line()

          ln[cl] = p
@@ -123,6 +124,13 @@ 

                      lnc = lnss

                      first = False

                  lnc[cl_match] = m

+             sel = pool.select(m, solv.Selection.SELECTION_CANON)

+             if sel.isempty():

+                 lnc[cl_repo] = "Unknown repo"

+             else:

+                 s = sel.solvables()

+                 assert len(s) == 1

+                 lnc[cl_repo] = str(s[0].repo)

      log.info(tb)

  

  FullInfo = collections.namedtuple('FullInfo', ['name', 'rpm', 'srpm', 'requires'])
@@ -154,7 +162,7 @@ 

      if log.getEffectiveLevel() <= logging.INFO or full_info:

          dep_details = _get_dependency_details(pool, solver.transaction())

          if log.getEffectiveLevel() <= logging.INFO:

-             print_transaction(dep_details)

+             print_transaction(dep_details, pool)

  

      if full_info:

          result = []

please pass it along with other stuff. I mean userdata should contain solvable.

Every query is very expensive.

Could you elaborate a little, please ?

Although I wonder if that's worth the effort, I've timed it a couple of times:

run with 2928 packages:

old version:
real 2m14,523s
user 2m13,981s
sys 0m0,199s

real 2m14,044s
user 2m13,540s
sys 0m0,178s

real 2m14,104s
user 2m13,559s
sys 0m0,205s

real 2m13,625s
user 2m13,071s
sys 0m0,212s

real 2m16,581s
user 2m16,041s
sys 0m0,188s

new version:
real 2m14,575s
user 2m13,718s
sys 0m0,309s

real 2m13,912s
user 2m13,375s
sys 0m0,211s

real 2m12,642s
user 2m12,034s
sys 0m0,237s

real 2m14,408s
user 2m13,845s
sys 0m0,221s

real 2m10,771s
user 2m10,216s
sys 0m0,215s

The system time is slightly higher, user and real times didn't change

I'll rebase/apply it as is. @ignatenkobrain, we can fix/augment things later on if needed.

Pull-Request has been merged by nphilipp

5 years ago
Metadata