PaulHowarth/Blog/2009-09-08

Tuesday 8th September 2009

Local Packages

  • New package autoconf260

  • Updated moin to 1.8.5 and added a patch I use at work to add an additional link in update notification emails, pointing to the updated page as opposed to the specific change

  • Updated perl-version to 0.7702

Fedora Project

  • Raised Bug #521869 on yum-arch relating to the deprecation warnings it emits on systems with python 2.6 and above:

  • /usr/share/yum-arch/yum/pgpmsg.py:16: DeprecationWarning: the sha module is
    deprecated; use the hashlib module instead
      import string, struct, time, cStringIO, base64, types, sha
    
    /usr/lib64/python2.6/gzip.py:117: DeprecationWarning: use the name attribute
      warnings.warn("use the name attribute", DeprecationWarning)
  • I've written a patch that seems to do the job for me, but I'm no python expert so I may have gotten it horribly wrong:
  • --- yum-2.2.2/rpmUtils/oldUtils.py.orig 2009-05-16 20:10:54.000000000 +0100
    +++ yum-2.2.2/rpmUtils/oldUtils.py      2009-09-08 15:19:47.494521706 +0100
    @@ -151,7 +151,10 @@
         def _write_gzip_header(self):
             self.fileobj.write('\037\213')             # magic header
             self.fileobj.write('\010')                 # compression method
    -        fname = self.filename[:-3]
    +        if self.name[-3:] != ".gz":
    +            fname = self.name
    +        else:
    +            fname = self.name[:-3]
             flags = 0
             if fname:
                 flags = FNAME
    --- yum-2.2.2/yum/pgpmsg.py.orig        2009-05-16 20:10:54.000000000 +0100
    +++ yum-2.2.2/yum/pgpmsg.py             2009-09-08 15:31:53.921273337 +0100
    @@ -13,7 +13,12 @@
     ##You should have received a copy of the GNU General Public License
     ##along with this program; if not, write to the Free Software
     ##Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    -import string, struct, time, cStringIO, base64, types, sha
    +import string, struct, time, cStringIO, base64, types
    +try:
    +    from hashlib import sha1 as sha
    +except:
    +    from sha import new as sha
    +
     
     debug = None
     
    @@ -385,7 +390,7 @@
                 #XXX do the v3 fingerprint here
             
             elif self.version == 4:
    -            s = sha.new()
    +            s = sha()
                 s.update(self.pkttag)
                 s.update(struct.pack(">H", pkt_len))
                 s.update(msg[idx_save:idx_save+pkt_len])


Recent