diff --git a/pungi/phases/init.py b/pungi/phases/init.py index 4b9916d1..c347222f 100644 --- a/pungi/phases/init.py +++ b/pungi/phases/init.py @@ -149,10 +149,12 @@ def create_comps_repo(compose, arch, variant): compose.log_warning("[SKIP ] %s" % msg) else: compose.log_info("[BEGIN] %s" % msg) - cmd = repo.get_createrepo_cmd(comps_repo, update=True, database=True, skip_stat=True, + cmd = repo.get_createrepo_cmd(comps_repo, database=False, outputdir=comps_repo, groupfile=comps_path, checksum=createrepo_checksum) - run(cmd, logfile=compose.paths.log.log_file(arch, "comps_repo"), show_cmd=True) + logfile = 'comps_repo-%s' % variant if variant else 'comps_repo' + run(cmd, logfile=compose.paths.log.log_file(arch, logfile), + show_cmd=True) compose.log_info("[DONE ] %s" % msg) diff --git a/tests/test_initphase.py b/tests/test_initphase.py index 1a3d10fe..5eaa3658 100644 --- a/tests/test_initphase.py +++ b/tests/test_initphase.py @@ -142,11 +142,29 @@ class TestCreateCompsRepo(PungiTestCase): [mock.call(['createrepo_c', self.topdir + '/work/x86_64/comps_repo', '--outputdir=%s/work/x86_64/comps_repo' % self.topdir, '--groupfile=%s/work/x86_64/comps/comps-x86_64.xml' % self.topdir, - '--update', '--skip-stat', '--database', '--checksum=sha256', + '--update', '--no-database', '--checksum=sha256', '--unique-md-filenames'], logfile=self.topdir + '/logs/x86_64/comps_repo.x86_64.log', show_cmd=True)]) + @mock.patch('pungi.phases.init.run') + def test_run_with_variant(self, run): + compose = DummyCompose(self.topdir, { + 'createrepo_checksum': 'sha256', + }) + compose.DEBUG = False + + init.create_comps_repo(compose, 'x86_64', compose.variants['Server']) + + self.assertEqual(run.mock_calls, + [mock.call(['createrepo_c', self.topdir + '/work/x86_64/comps_repo_Server', + '--outputdir=%s/work/x86_64/comps_repo_Server' % self.topdir, + '--groupfile=%s/work/x86_64/comps/comps-Server.x86_64.xml' % self.topdir, + '--update', '--no-database', '--checksum=sha256', + '--unique-md-filenames'], + logfile=self.topdir + '/logs/x86_64/comps_repo-Server.x86_64.log', + show_cmd=True)]) + @mock.patch('pungi.phases.init.run') def test_run_in_debug(self, run): compose = DummyCompose(self.topdir, {