rpms/papyon/devel papyon-work-around-invalid-SHA1D.patch, NONE, 1.1 .cvsignore, 1.6, 1.7 papyon.spec, 1.6, 1.7 sources, 1.6, 1.7

Brian Pepple bpepple at fedoraproject.org
Sat May 8 20:55:26 UTC 2010


Author: bpepple

Update of /cvs/pkgs/rpms/papyon/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv26584

Modified Files:
	.cvsignore papyon.spec sources 
Added Files:
	papyon-work-around-invalid-SHA1D.patch 
Log Message:
* Sat May  8 2010 Brian Pepple <bpepple at fedoraproject.org> - 0.4.6-1
- Update to 0.4.6.
- Backport patch to work around invalid SHA1D attributes in msn objects. (#568923)


papyon-work-around-invalid-SHA1D.patch:
 p2p.py |   26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

--- NEW FILE papyon-work-around-invalid-SHA1D.patch ---
diff -urp papyon-0.4.6.OLD/papyon/p2p.py papyon-0.4.6/papyon/p2p.py
--- papyon-0.4.6.OLD/papyon/p2p.py	2010-03-19 20:01:44.000000000 -0400
+++ papyon-0.4.6/papyon/p2p.py	2010-05-08 16:34:21.847677296 -0400
@@ -65,6 +65,30 @@ class MSNObjectType(object):
     LOCATION = 14
     "Location"
 
+def __decode_shad(shad, warning=True):
+    try:
+        shad = base64.b64decode(shad)
+    except TypeError:
+        # See fd.o#27672 for details on this workaround.
+        if ' ' in shad:
+            parts = shad.split(' ')
+
+            # Try the first part.
+            shad = __decode_shad(parts[0], False)
+
+            # Try the second part.
+            if shad is None:
+                shad = __decode_shad(parts[1], False)
+
+        else:
+            # Only display this warning if we're not in a nested call otherwise the
+            # warning will be confusing.
+            if warning:
+                logger.warning("Invalid SHA1D in MSNObject: %s" % shad)
+            shad = None
+
+    return shad
+
 class MSNObject(object):
     "Represents an MSNObject."
     def __init__(self, creator, size, typ, location, friendly,
@@ -156,7 +180,7 @@ class MSNObject(object):
         friendly = base64.b64decode(xml.unescape(element["Friendly"]))
         shad = element.get("SHA1D", None)
         if shad is not None:
-            shad = base64.b64decode(shad)
+            shad = __decode_shad(shad)
         shac = element.get("SHA1C", None)
         if shac is not None:
             try:


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/papyon/devel/.cvsignore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- .cvsignore	10 Mar 2010 19:58:50 -0000	1.6
+++ .cvsignore	8 May 2010 20:55:25 -0000	1.7
@@ -1 +1 @@
-papyon-0.4.5.tar.gz
+papyon-0.4.6.tar.gz


Index: papyon.spec
===================================================================
RCS file: /cvs/pkgs/rpms/papyon/devel/papyon.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- papyon.spec	10 Mar 2010 19:58:50 -0000	1.6
+++ papyon.spec	8 May 2010 20:55:25 -0000	1.7
@@ -1,7 +1,7 @@
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 Name:           papyon
-Version:        0.4.5
+Version:        0.4.6
 Release:        1%{?dist}
 Summary:        Python libraries for MSN Messenger network
 
@@ -9,6 +9,7 @@ Group:          Development/Languages
 License:        GPLv2+
 URL:            http://telepathy.freedesktop.org/wiki/Papyon
 Source0:        http://telepathy.freedesktop.org/releases/%{name}/%{name}-%{version}.tar.gz
+Patch0:		papyon-work-around-invalid-SHA1D.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -32,6 +33,7 @@ asynchronous manner
 
 %prep
 %setup -q
+%patch0 -p1 -b .sha1d
 %{__sed} -i 's|\#!/usr/bin/env python||' papyon/msnp2p/test.py
 
 
@@ -55,6 +57,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sat May  8 2010 Brian Pepple <bpepple at fedoraproject.org> - 0.4.6-1
+- Update to 0.4.6.
+- Backport patch to work around invalid SHA1D attributes in msn objects. (#568923)
+
 * Wed Mar 10 2010 Brian Pepple <bpepple at fedoraproject.org> - 0.4.5-1
 - Update to 0.4.5.
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/papyon/devel/sources,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- sources	10 Mar 2010 19:58:51 -0000	1.6
+++ sources	8 May 2010 20:55:26 -0000	1.7
@@ -1 +1 @@
-831890ebfe0f12c56de9effb70082e50  papyon-0.4.5.tar.gz
+a486d2ae3adf02573bb6e7b0f4fe7bd4  papyon-0.4.6.tar.gz



More information about the scm-commits mailing list