diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py index 98863b98aea8a8ba0454cf5e6bc13bd532f8bbe5..e0091bfef785a1218ad7808353c9fb556bc7b392 100644 --- a/python/dnfdaemon/server/__init__.py +++ b/python/dnfdaemon/server/__init__.py @@ -741,7 +741,7 @@ class DnfDaemonBase(dbus.service.Object, DownloadCallback): output = e.value.split('. ') if rc: for tsi in self.base.transaction: - print(tsi.op_type, tsi.installed, tsi.erased, tsi.obsoleted) + #print(tsi.op_type, tsi.installed, tsi.erased, tsi.obsoleted) if tsi.op_type == dnf.transaction.DOWNGRADE: b['downgrade'].append(tsi) elif tsi.op_type == dnf.transaction.ERASE: diff --git a/python/dnfdaemon/server/backend.py b/python/dnfdaemon/server/backend.py index 51a828206b76dd80011abc99a1459ef6cbf8ec80..8529e5c909f5484eea34bbd347d1a84cb00fbe91 100644 --- a/python/dnfdaemon/server/backend.py +++ b/python/dnfdaemon/server/backend.py @@ -44,7 +44,8 @@ class DnfBase(dnf.Base): super(DnfBase, self).__init__() self.parent = parent self.md_progress = MDProgress(parent) - self.setup_cache() + RELEASEVER = dnf.rpm.detect_releasever(self.conf.installroot) + self.conf.substitutions['releasever'] = RELEASEVER self.read_all_repos() self.progress = Progress(parent, max_err=100) self.repos.all().set_progress_bar(self.md_progress) @@ -64,19 +65,6 @@ class DnfBase(dnf.Base): def packages(self): return self._packages - def cachedir_fit(self, conf): - subst = conf.substitutions - # this is not public API, same procedure as dnf cli - suffix = dnf.conf.parser.substitute(dnf.const.CACHEDIR_SUFFIX, subst) - cli_cache = dnf.conf.CliCache(conf.cachedir, suffix) - return cli_cache.cachedir, cli_cache.system_cachedir - - def setup_cache(self): - """Setup the dnf cache, same as dnf cli""" - conf = self.conf - conf.cachedir, self._system_cachedir = self.cachedir_fit(conf) - logger.debug("cachedir: %s", conf.cachedir) - def set_max_error(self, max_err): """Setup a new progress object with a new max number of download errors. diff --git a/test/test_common.py b/test/test_common.py index cf402a6a20ebc35b3f30c4b8438579870521aadb..c67d2d8403b588f56c485c023dfe71e21b1d6001 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -47,7 +47,6 @@ class TestPackages(support.TestCase): pkgs = backend.Packages(base) inst = list(map(str, pkgs.installed)) print - print(inst) self.assertEqual(inst, ['bar-1.0-1.noarch', 'foo-2.0-1.noarch', 'bar-old-1.0-1.noarch', @@ -104,7 +103,7 @@ class TestDnfBase(support.TestCase): """Test search (dups)""" found = self.base.search(['name'], ['foo'], showdups=True) res = list(map(str, found)) - print(res) + #print(res) self.assertEqual(res, ['foo-2.0-1.noarch', 'foo-2.0-1.noarch', @@ -142,7 +141,7 @@ class TestBrokenDeps(TestCommonBase): self.assertEqual(res, ['broken,0,1.0,1,noarch,broken', 'dep01,0,1.0,1,noarch,broken']) rc, msgs = json.loads(self.daemon.install('broken')) - print(rc, msgs) + #print(rc, msgs) self.assertEqual(False, rc) self.assertEqual(['nothing provides not-found-dep01 >= ' '1-0 needed by dep01-1.0-1.noarch'], msgs) @@ -275,7 +274,7 @@ class TestCommonGroups(TestCommonBase): def test_get_groups(self): res = self.daemon.get_groups() - print(json.loads(res)) + #print(json.loads(res)) self.assertEqual(json.loads(res), [[["Base System", "Base System", "Various core pieces of the system."], @@ -316,13 +315,13 @@ class TestCommonGroups(TestCommonBase): """Test group_remove""" cmds = "inst-grp" prst = self.daemon.base.group_persistor - print(json.dumps(prst.db.dct)) + #print(json.dumps(prst.db.dct)) p_grp = prst.group(cmds) self.assertTrue(p_grp.installed) res = self.daemon.group_remove(cmds) - print(json.loads(res)) + #print(json.loads(res)) self.assertFalse(p_grp.installed) - print(json.dumps(prst.db.dct)) + #print(json.dumps(prst.db.dct)) class TestCommonInstall(TestCommonBase): @@ -457,7 +456,7 @@ class TestCommonTransaction(TestCommonBase): [True, [['install', [['petzoo,0,1.0,1,noarch,main', 0.0, []]]]]]) # test _get_transaction() trans = self.daemon.build_transaction() - print(json.loads(trans)) + #print(json.loads(trans)) self.assertEqual(json.loads(trans), [True, [['install', [['petzoo,0,1.0,1,noarch,main', 0.0, []]]]]]) diff --git a/test/test_data/repos/main.repo b/test/test_data/repos/main.repo index c71615942aada60d7494307f7e930a1f95c9018f..ccb9fcf761525b7ec8457ca2f264548e2751b491 100644 --- a/test/test_data/repos/main.repo +++ b/test/test_data/repos/main.repo @@ -14,7 +14,7 @@ =Pkg: bar-dep-err 1.0 1 noarch =Req: not-found-dep >= 1-0 =Pkg: bar-new 2.0 1 noarch -=Obs: bar-old 1.0 1 noarch -=Obs: old-bar 1.0 1 noarch +=Obs: bar-old +=Obs: old-bar =Pkg: petzoo 1.0 1 noarch