[tools] Request for having plugins for mrepo

apratyaksh apratyaksh at gmail.com
Thu Apr 10 16:31:58 CEST 2008


Dag Wieers wrote:
> On Fri, 4 Apr 2008, apratyaksh wrote:
>
>> Ian Forde wrote:
>>> On Fri, 2008-04-04 at 19:09 +0100, apratyaksh wrote:
>>>
>>>> I am using mrepo for hosting a lot of isos (mostly redhat based 
>>>> ones) and it has been a useful tool.
>>>> I would like to ask for a additional feature in mrepo. A lot of 
>>>> time I have to use some custom  scripts  on the mrepo
>>>> repositories to generate information base on the repository  like 
>>>> the yum/apt configuration files which can be downloaded by users
>>>> or a master boot image which can boot all available distros of a 
>>>> arch (unfortunately our environment cannot use PXE a lot of time) etc.
>>>>
>>>> Most of the time I have shell scripts ending up in cron jobs, so 
>>>> even after doing a regeneration  of repositories  with mrepo  all 
>>>> is not updated
>>>> as I have to run the cron jobs manually.
>>>>
>>>> Will it be possible to have some plugins to mrepo or some way to 
>>>> call a external script per repository ?
>>>>
>>>
>>> Why not call your script from within the mrepo cron script to run right
>>> after mrepo itself?
>>>
>>>     -I
>>
>> Yes this can be done but I was looking for something that can target 
>> a particular repository, like the way
>> mrepo does. So that I don't have to run the script on the whole repo 
>> but only where mrepo was run.
>>
>> I see mrepo also does some checks to update repository only if required.
>>
>> Do you think this will be good ?
>
> I think that would be very useful but I have no experience in writing 
> a plugin infrastructure. I am sure that in your scripts you would like 
> to use information that mrepo holds (like the repo path, name) and 
> that you want to be able to run a script in different places within 
> mrepo.
>
> If we can describe what we want to do and how we want to do it (with 
> the maximum flexibility) we can look at how to implement it.
>
Hello Dag,

Thanks for considering the feature.

Sure I would like to have info from mrepo (as you mention repository 
path, distro name etc).
Currently I have only very basic requirement. As I mentioned I use the 
scripts to generate config files for
the repository which is per distro(rhel4-i386, rhel5-i386 etc.). This 
needs to run whenever new repo is added for the distro.
Another script to generate a combined boot image for all the distros on 
my server. This needs to run whenever
a new distro is added. There may be reasons to run scripts if rpms are 
added to the repository. I dont have a
usecase right now for this.

I am not an expert in plugins either, but this is what I was looking at.

* a plugins dir in which I can drop my scripts.

* a config option in mrepo.conf pointing to the plugins dir.

* may be a function in mrepo to call these scripts whenever  mrepo is 
called (ofcourse i would like to get
the plugins run only if required, like repo generation)

* as for the information that needs to be passed to the plugins, I would 
like to access the config info(not sure
if this is required though), the distro name, repository name.

Most of scripts are in bash, but I am ready to go for python depending 
on how I need to access the info provided
by mrepo.

This is all I can think of right now. If someone on the list has a 
better approach, I would definitely be interested.
I looked at yum for reference on the plugin system, yum provides a 
config file per plugin, but may be we can have
a basic system to start with.

How do you feel about the approach ?

Regards
Apratyaksh joe



More information about the tools mailing list