[Yum-devel] pre,post jobs

seth vidal skvidal at phy.duke.edu
Sun Jun 6 15:04:39 UTC 2004


Icon and I talked this out over lunch last week, it's something that's
been proposed before but I think the idea that we (mostly he) came up
with will be the most easy to implement and more portable to other
tools.

at various stages in the yum process, yum should create an instance of
this class, pack it with some data and let it do its thing. "Its thing"
consists of reading an xml configuration file for what actions are
associated with what processes occurring to packages. For example:

- before the transaction runs
   - if the package list contains glibc in the remove state
      prompt for confirmation from the user and/or exit

- before the individual transaction event for the package occurs
   - if the package matches bar*
      run /etc/init.d/bar stop

- after the individual transaction event for the package occurs
   - if the package matches bar*
      run /etc/init.d/bar start

- after the transaction finishes
   - if the package list contains a kernel
      make a certain kernel the default boot kernel by running the 
      following script....

myobj = slotsclass()
listOfPkgTuples = [((name, arch, epoch, ver, rel), 'remove', ''),
           ((name2, arch2, epoch2, ver2, rel2), 'updates', (n3, a3, e3, 
            v3, r3))]

myobj.run('pretrans', listOfPkgTuples)

This way a user could call any script they want for various packages.

The object can be completely ignorant of yum, it just needs to have
certain data packed into it. A user could do any manner of stupid stuff
here, too, of course, that's their problem, the default behaviors would
be simple.

Thoughts? 
-sv








More information about the Yum-devel mailing list