[Yum-devel] pre,post jobs

Michael Stenner mstenner at linux.duke.edu
Mon Jun 7 15:32:07 UTC 2004


On Sun, Jun 06, 2004 at 11:04:39AM -0400, seth vidal wrote:
> 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.

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

I think I see.  The object (myobj in this case) is loaded with the xml
configuration.  Then, a list of package tuples is formed that reflects
the interesting stuff that's about to happen (meaning it does not
include "mozilla is fine - we're leaving it untouched).  Finally, the
list of packages is passed to the object along with the "mode".  In a
given invocation of "yum update" (say), the .run method would be
called several times with different modes (but probably the same
package list).  Is that right?

I think this sounds great.  I also think XML is a good choice.
Because of the coolness of xml, what I'm about to suggest is probably
not an issue, but here goes:

  1) I'd try to leave these rules and actions as general as possible.
     For example, it might be convenient for the condition to be a
     simple package name match in the install state.  It might also be
     "is the minor version number even?".  Finally, it might be nice
     to be able to do such testing via some python code.  As usual,
     I'd probably implement it GENERALLY as a python function, and
     then implement specific matches as specific functions.

  2) Same thing with actions.  I'd prefer to see it implemented
     interally as a general python function.  A specific python
     function could be a thin layer over os.system or popen*.

  3) Finally, it would be cool if people could simply drop such xml
     files in a directory rather than edit them by hand.  I expect
     that most users will never EDIT such things, but I can see the
     community sharing them.  This can probably be done through XML
     itself.  I know XML can link in other files.  Can it link in
     /foo/bar/*.xml ?  Icon?

					-Michael
-- 
  Michael D. Stenner                            mstenner at ece.arizona.edu
  ECE Department, the University of Arizona                 520-626-1619
  1230 E. Speedway Blvd., Tucson, AZ 85721-0104                 ECE 524G



More information about the Yum-devel mailing list