diff --git a/pungi/checks.py b/pungi/checks.py index 148e78f0..513c2cb8 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -97,13 +97,13 @@ tools = [ ("genisoimage", "/usr/bin/genisoimage", is_genisoimage_needed), ("gettext", "/usr/bin/msgfmt", None), ("syslinux", "/usr/bin/isohybrid", is_isohybrid_needed), - # modifyrepo can always be called - ("createrepo", "/usr/bin/modifyrepo", None), - # createrepo and mergerepo are not needed by default, only when + # createrepo, modifyrepo and mergerepo are not needed by default, only when # createrepo_c is not configured ("createrepo", "/usr/bin/createrepo", lambda conf: not is_createrepo_c_needed(conf)), + ("createrepo", "/usr/bin/modifyrepo", lambda conf: not is_createrepo_c_needed(conf)), ("createrepo", "/usr/bin/mergerepo", lambda conf: not is_createrepo_c_needed(conf)), ("createrepo_c", "/usr/bin/createrepo_c", is_createrepo_c_needed), + ("createrepo_c", "/usr/bin/modifyrepo_c", is_createrepo_c_needed), ("createrepo_c", "/usr/bin/mergerepo_c", is_createrepo_c_needed), ("yum-utils", "/usr/bin/repoquery", None), diff --git a/pungi/wrappers/createrepo.py b/pungi/wrappers/createrepo.py index 0db8b24d..cf34cce8 100644 --- a/pungi/wrappers/createrepo.py +++ b/pungi/wrappers/createrepo.py @@ -22,10 +22,11 @@ class CreaterepoWrapper(object): if createrepo_c: self.createrepo = "createrepo_c" self.mergerepo = "mergerepo_c" + self.modifyrepo = "modifyrepo_c" else: self.createrepo = "createrepo" self.mergerepo = "mergerepo" - self.modifyrepo = "modifyrepo" + self.modifyrepo = "modifyrepo" def get_createrepo_cmd(self, directory, baseurl=None, outputdir=None, excludes=None, pkglist=None, groupfile=None, cachedir=None, update=True, diff --git a/tests/test_checks.py b/tests/test_checks.py index 06c36ae3..bcb24641 100644 --- a/tests/test_checks.py +++ b/tests/test_checks.py @@ -150,11 +150,20 @@ class CheckDependenciesTestCase(unittest.TestCase): with mock.patch('sys.stdout', new_callable=StringIO) as out: with mock.patch('os.path.exists') as exists: exists.side_effect = self.dont_find(['/usr/bin/modifyrepo']) - result = checks.check({}) + result = checks.check({'createrepo_c': False}) self.assertIn('createrepo', out.getvalue()) self.assertFalse(result) + def test_requires_modifyrepo_c(self): + with mock.patch('sys.stdout', new_callable=StringIO) as out: + with mock.patch('os.path.exists') as exists: + exists.side_effect = self.dont_find(['/usr/bin/modifyrepo_c']) + result = checks.check({'createrepo_c': True}) + + self.assertIn('createrepo_c', out.getvalue()) + self.assertFalse(result) + def test_requires_createrepo_c(self): with mock.patch('sys.stdout', new_callable=StringIO) as out: with mock.patch('os.path.exists') as exists: