[jabberpy/f19] add missing patches from EPEL builds

Milan Zazrivec mzazrive at fedoraproject.org
Tue Jul 8 14:38:56 UTC 2014


commit 2514cb8d041c1eddd26615f4302baec5df0eafd3
Author: Milan Zazrivec <mzazrivec at redhat.com>
Date:   Tue Jul 8 16:38:46 2014 +0200

    add missing patches from EPEL builds

 jabberpy-proxy-read.patch      |   11 +++++++++++
 jabberpy-sha-deprecation.patch |   40 ++++++++++++++++++++++++++++++++++++++++
 jabberpy.spec                  |    8 ++++++++
 3 files changed, 59 insertions(+), 0 deletions(-)
---
diff --git a/jabberpy-proxy-read.patch b/jabberpy-proxy-read.patch
new file mode 100644
index 0000000..e723ee7
--- /dev/null
+++ b/jabberpy-proxy-read.patch
@@ -0,0 +1,11 @@
+--- jabberpy-0.5-0/jabber/xmlstream.py
++++ jabberpy-0.5-0/jabber/xmlstream.py
+@@ -522,7 +522,7 @@ class Client(Stream):
+             connector.append('\r\n')
+             bak = self._read , self._write
+             self.write('\r\n'.join(connector))
+-            reply = self.read().replace('\r','')
++            reply = self._read(BLOCK_SIZE).replace('\r','')
+             self._read , self._write = bak
+             try: proto,code,desc=reply.split('\n')[0].split(' ',2)
+             except: raise error('Invalid proxy reply')
diff --git a/jabberpy-sha-deprecation.patch b/jabberpy-sha-deprecation.patch
new file mode 100644
index 0000000..60c688a
--- /dev/null
+++ b/jabberpy-sha-deprecation.patch
@@ -0,0 +1,40 @@
+--- jabber/jabber.py   2011-02-22 11:15:44.706037736 +0100
++++ jabber/jabber.py   2011-02-22 11:31:25.628921665 +0100
+@@ -65,7 +65,8 @@
+ # $Id: jabber.py,v 1.58 2004/01/18 05:27:10 snakeru Exp $
+ 
+ import xmlstream
+-import sha, time
++import time
++import hashlib
+ 
+ debug=xmlstream.debug
+ 
+@@ -524,7 +525,7 @@
+             token = auth_ret_query.getTag('token').getData()
+             seq = auth_ret_query.getTag('sequence').getData()
+             self.DEBUG("zero-k authentication supported",(DBG_INIT,DBG_NODE_IQ))
+-            hash = sha.new(sha.new(passwd).hexdigest()+token).hexdigest()
++            hash = hashlib.new('sha1', hashlib.new('sha1', passwd).hexdigest()+token).hexdigest()
+             for foo in xrange(int(seq)): hash = sha.new(hash).hexdigest()
+             q.insertTag('hash').insertData(hash)
+ 
+@@ -532,7 +533,7 @@
+ 
+             self.DEBUG("digest authentication supported",(DBG_INIT,DBG_NODE_IQ))
+             digest = q.insertTag('digest')
+-            digest.insertData(sha.new(
++            digest.insertData(hashlib.new('sha1',
+                 self.getIncomingID() + passwd).hexdigest() )
+         else:
+             self.DEBUG("plain text authentication supported",(DBG_INIT,DBG_NODE_IQ))
+@@ -1397,7 +1398,7 @@
+     def auth(self,secret):
+         """will disconnect on failure"""
+         self.send( u"<handshake id='1'>%s</handshake>"
+-                   % sha.new( self.getIncomingID() + secret ).hexdigest()
++                   % hashlib.new('sha1', self.getIncomingID() + secret ).hexdigest()
+                   )
+         while not self._auth_OK:
+             self.DEBUG("waiting on handshake")
+
diff --git a/jabberpy.spec b/jabberpy.spec
index 868f4a1..ebba330 100644
--- a/jabberpy.spec
+++ b/jabberpy.spec
@@ -12,6 +12,8 @@ Source0:       http://downloads.sf.net/sourceforge/%{name}/%{name}-%{version}-0.
 Patch0:        jabberpy-no-init.patch
 Patch1:        jabberpy-clean-sockets.patch
 Patch2:        jabberpy-ipv6.patch
+Patch3:        jabberpy-sha-deprecation.patch
+Patch4:        jabberpy-proxy-read.patch
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:     noarch
@@ -31,6 +33,8 @@ chmod -x examples/*.py
 %patch0 -p1 -b .no-init
 %patch1 -p1 -b .clean-sockets
 %patch2 -p0 -b .ipv6
+%patch3 -p0 -b .sha-deprecation
+%patch4 -p1 -b .proxy
 
 %build
 %{__python} setup.py  build
@@ -49,6 +53,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Tue Jul  8 2014 Milan Zazrivec <mzazrivec at redhat.com> 0.5-0.27
+- fix sha module deprecation warning
+- use blocking read in initial communication with http proxy
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.5-0.26
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list