[Yum] keepalive and file:// support

Michael Stenner mstenner at phy.duke.edu
Thu Feb 6 22:30:25 UTC 2003


I have for your amusement some code.  Notes:

1) this will only work under python 2.x (so NOT RHL 7.x)

2) the actual clientStuff.py patch is untested.  I do not have an 8.x
   box.

You will find the following in this directory:
  http://www.dulug.duke.edu/~mstenner/misc/keepalive/

1) clientStuff.py.bak from the yum-20030203.tar.gz daily
2) the modified clientStuff.py
3) the patch: clientStuff.py.keepalive
4) the keepalive.py module - others may find this of general interest
5) example.py - simple example of how to use keepalive.py
6) urlgrab.py - the primary function that was replaced in clientStuff.py

Seth, I also made some small cleanup changes (couldn't help
myself... you know how I am).  I don't think I changed the
functionality of anything.  Again, untested...

This patch adds file url (file://) support, but in a stupid way for
the moment.  Everything (headers.info, *.hdr, *.rpm) is still copied
to the cache directory.  Facility is provided for fixing this, but I
thought I'd leave that to you, Seth.  Basically, you just do

filename = urlgrab(url, localfile, copy_local=0)

If copy_local == 0, then filename will be url (tidied and
un-URL-ified).  If copy_local == 1, then the file will be copied to
localfile, and filename will be set to localfile.  copy_local is
completely ignored for non-file urls.

Enjoy.
					-Michael
-- 
  Michael Stenner                       Office Phone: 919-660-2513
  Duke University, Dept. of Physics       mstenner at phy.duke.edu
  Box 90305, Durham N.C. 27708-0305



More information about the Yum mailing list