[Revisor-users] Some questions on comps.xml and kcikstart file

Jeroen van Meeuwen kanarip at kanarip.com
Thu Nov 22 14:38:35 UTC 2007


Alexander Todorov wrote:
> Jeroen van Meeuwen wrote:
>   > The code to filter out anything that is not in the package set is 
> either
>> in anaconda (but I'm not sure if code to 'not show' missing packages is 
>> actually useful for writing out an efficient comps file), or hasn't been 
>> written (yet).
>>
>> Any ideas though on how to filter 'missing' packages out of the comps 
>> file are very much welcome.
>>
> 
> Here is a quick and simple idea. It probably needs some bug fixing:
> 1) During RPM download phase generate a list of available packages. This 
> is what will end up on the final media and ideally dependencies are 
> satisfies (unless something goes wrong)
> 
> 2) Merge comps.xml files found in all repositories as it is now.
> 3) For each <group> tag inspect the <packagelist> and <packagereq> tags.
> If the listed package is not in the list of downloaded packages then 
> remove it from XML.
> 3) For each <group> if <packagelist> is empty then remove this group 
> (adding the id to a reference list)
> 4) Under <grouphierarchy> tag inspect every <category>.
>    4.1) Under the <category> tag inspect every <subcategories>, 
> <subcategory> tag. If listing a group id that is already deleted (check 
> reference list) then delete this subcategory.
>    4.2) If for <category> the <subcategories> tag is an empty list then 
> delete this category.
> 5) Result should be comps.xml containing only description of groups and 
> packages only available at install media.
> 
> Jeroen is the above useful?
> I was asking for reference file/line in Revisor's code where the comps 
> merging is performed. I you think the above will work (and I can test 
> it) then I am willing to create a patch.
> 

Line 118 in revisor/cfg.py (branch master is what you will want to be 
working on) is a function that does the following:

1) If you choose to use the comps file Revisor ships (just some updated 
comps file), which is off by default (unless you specify 
--revisor-comps), return the path to that comps file.

2) Otherwise, merge the comps files from all the repositories (and clean 
it up a little so no duplicate categories/groups/packages exist 
anymore), write that out somewhere and return the path to that newly 
created comps file.

Ideally you'd be looking at a command-line switch (say --comps-cleanup) 
which sets ConfigStore.comps_cleanup to True or False (False by 
default), adding a third if 3) to ConfigStore.get_comps() to just clean 
it out (after 2) has been performed). It makes sense to not do two 
seperate mergers in both 2) and 3), right?

Let me know what you think, I'll gladly accept a patch ;-)

Kind regards,

Jeroen van Meeuwen
-kanarip


More information about the Revisor-users mailing list