As everybody knows, up2date has been deprecated in recent RHELs, and replaced by Yum. That's great.

But what if you still need to use up2date on a modern distribution, like RHEL5 or Fedora Core 8, for instance? What would you need to do that, anyway ? Well, let's just imagine for a few minutes that you want to run a local RHN mirror for your old RHEL4 machines, but that this mirror would also need to run other stuff requiring modernities? You may then want to install something like FC8, but still run up2date to synchronize your local RHN repository.

Ok, why not.

Oh, that's pretty simple: because up2date doesn't work with Python 2.5 (which is the default in FC8). Usually, that's the other way around: software written for Python 2.5 don't work with earlier versions of the interpreter. But here, no. Ascending compatibility is a dirty word.

Anyway, here's a patch to make up2date work again with Python 2.5.

--- /usr/lib/python2.5/site-packages/rhn/     2008-06-16 15:51:49.000000000 -0700
+++ /usr/lib/python2.5/site-packages/rhn/  2008-06-16 15:52:13.000000000 -0700
@@ -37,7 +37,7 @@
     user_agent = "" % __version__

     def __init__(self, transfer=0, encoding=0, refreshCallback=None,
-            progressCallback=None):
+            progressCallback=None, use_datetime = 0):
         self._transport_flags = {'transfer' : 0, 'encoding' : 0}
         self.set_transport_flags(transfer=transfer, encoding=encoding)
         self._headers = UserDictCase()
@@ -52,6 +52,7 @@
         self.response_status = None
         self.response_reason = None
         self._redirected = None
+        self._use_datetime = use_datetime

     # set the progress callback
     def set_progress_callback(self, progressCallback, bufferSize=16384):

Not much, but I had to write it somewhere for next time.