init: Remove keep_original_comps option
The same information can be inferred from definitions in variants.xml: if the variant has no groups defined, we include packages from all groups. By the same logic we can also include all groups in the comps file. The config validation is updated to give a hint on how to remove the option from the configuration. Relates: #29 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
c118adc705
commit
a042906717
5 changed files with 24 additions and 42 deletions
|
|
@ -48,10 +48,9 @@ class TestInitPhase(PungiTestCase):
|
|||
@mock.patch('pungi.phases.init.write_prepopulate_file')
|
||||
def test_run_with_preserve(self, write_prepopulate, write_variant, create_comps,
|
||||
write_arch, write_global, copy_comps):
|
||||
compose = DummyCompose(self.topdir, {
|
||||
'keep_original_comps': ['Everything'],
|
||||
})
|
||||
compose = DummyCompose(self.topdir, {})
|
||||
compose.has_comps = True
|
||||
compose.variants['Everything'].groups = []
|
||||
phase = init.InitPhase(compose)
|
||||
phase.run()
|
||||
|
||||
|
|
@ -90,6 +89,20 @@ class TestInitPhase(PungiTestCase):
|
|||
self.assertItemsEqual(copy_comps.mock_calls, [])
|
||||
|
||||
|
||||
class TestCopyVariantComps(PungiTestCase):
|
||||
|
||||
@mock.patch('shutil.copy')
|
||||
def test_run(self, copy):
|
||||
compose = DummyCompose(self.topdir, {})
|
||||
variant = compose.variants['Server']
|
||||
|
||||
init.copy_variant_comps(compose, 'x86_64', variant)
|
||||
|
||||
self.assertEqual(copy.mock_calls,
|
||||
[mock.call(self.topdir + '/work/global/comps/comps-global.xml',
|
||||
self.topdir + '/work/x86_64/comps/comps-Server.x86_64.xml')])
|
||||
|
||||
|
||||
class TestWriteArchComps(PungiTestCase):
|
||||
|
||||
@mock.patch('pungi.phases.init.run')
|
||||
|
|
@ -222,19 +235,5 @@ class TestWriteVariantComps(PungiTestCase):
|
|||
self.assertEqual(comps.write_comps.mock_calls, [])
|
||||
|
||||
|
||||
class TestCopyVariantComps(PungiTestCase):
|
||||
|
||||
@mock.patch('shutil.copy')
|
||||
def test_run(self, copy):
|
||||
compose = DummyCompose(self.topdir, {})
|
||||
variant = compose.variants['Server']
|
||||
|
||||
init.copy_variant_comps(compose, 'x86_64', variant)
|
||||
|
||||
self.assertEqual(copy.mock_calls,
|
||||
[mock.call(self.topdir + '/work/global/comps/comps-global.xml',
|
||||
self.topdir + '/work/x86_64/comps/comps-Server.x86_64.xml')])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue