#68 When tracking package dependencies, look at pre-requires, not just normal reqs
Merged 6 years ago by karsten. Opened 6 years ago by otaylor.
modularity/ otaylor/fedmod all-requires  into  master

file modified
+7 -1
@@ -72,12 +72,18 @@ 

      assert len(solvables) == 1

      return solvables[0]

  

+ def _iterate_all_requires(package):

+     for dep in package.lookup_deparray(solv.SOLVABLE_REQUIRES, 1): # pre-requires

+         yield dep

+     for dep in package.lookup_deparray(solv.SOLVABLE_REQUIRES, -1): # requires

+         yield dep

+ 

  def _get_dependency_details(pool, transaction):

      candq = transaction.newpackages()

      result = {}

      for p in candq:

          pkg_details = {}

-         for dep in p.lookup_deparray(solv.SOLVABLE_REQUIRES):

+         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

package.lookup_deparray(solv.SOLVABLE_REQUIRES) only returns normal Requires:,
to get pre-requires, you need to pass in marker=1 (default is marker=-1)

Looks good to me, although I'd wish there was a way to disable the new behaviour with a commandline switch

Are you confusing pre-requires with recommends? I don't see a use case for
disabling only those requirements that are supposed to be installed before
the package.

On Tue, Apr 3, 2018, 7:01 AM Karsten Hopp pagure@pagure.io wrote:

karsten commented on the pull-request: When tracking package dependencies, look at pre-requires, not just normal reqs that you are
following:
Looks good to me, although I'd wish there was a way to disable the new behaviour with a commandline switch

To reply, visit the link below or just reply to this email
https://pagure.io/modularity/fedmod/pull-request/68

I don't think I've confused pre-requires and recommendations. I was only concerned about the changed behaviour where it now finds more requirements. After giving this a second thought, I think you're right. We need those new packages anyway to be able to install a given rpm, it is just a matter of when exactly those packages are required.

Pull-Request has been merged by karsten

6 years ago
Metadata