[Yum] keepalive and file:// support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx
  Box 90305, Durham N.C. 27708-0305


[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux