Blob Blame History Raw
From f05c55d30a135d035510d04433432625bb008101 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
Date: Mon, 10 Jun 2019 12:51:29 +0200
Subject: [PATCH] Hotfix for libdnf in Fedora >= 29

---
 rpmdeplint/__init__.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/rpmdeplint/__init__.py b/rpmdeplint/__init__.py
index 3de8e05..a69b60d 100644
--- a/rpmdeplint/__init__.py
+++ b/rpmdeplint/__init__.py
@@ -125,7 +125,7 @@ class DependencyAnalyzer(object):
         self.repos_by_name = {}  #: mapping of (reponame, rpmdeplint.Repo)
         for repo in repos:
             repo.download_repodata()
-            self._sack.load_yum_repo(repo=repo.as_hawkey_repo(), load_filelists=True)
+            self._sack.load_repo(repo=repo.as_hawkey_repo(), load_filelists=True)
             self.repos_by_name[repo.name] = repo
 
     def __enter__(self):
@@ -184,7 +184,7 @@ class DependencyAnalyzer(object):
             results['upgrades'] = g.list_upgrades()
             results['erasures'] = g.list_erasures()
         else:
-            results['problems'] = g.problems
+            results['problems'] = [': '.join(problem) for problem in g.problem_rules()]
 
         return install_succeeded, results
 
@@ -263,12 +263,13 @@ class DependencyAnalyzer(object):
         g.install(left)
         g.install(right)
         g.run()
-        if g.problems and 'conflicts' in g.problems[0]:
+        problems = [': '.join(problem) for problem in g.problem_rules()]
+        if problems and 'conflicts' in problems[0]:
             logger.debug('Found explicit Conflicts between %s and %s', left, right)
             return False
-        if g.problems and \
-           six.text_type(right) in g.problems[0] and \
-           'none of the providers can be installed' in g.problems[0]:
+        if problems and \
+           six.text_type(right) in problems[0] and \
+           'none of the providers can be installed' in problems[0]:
             logger.debug("Packages can't be installed together and won't conflict %s and %s", left, right)
             return False
         return True
-- 
2.21.0