[57313] trunk/dports/python/py26-crypto

ram at macports.org ram at macports.org
Wed Sep 9 05:59:24 PDT 2009


Revision: 57313
          http://trac.macports.org/changeset/57313
Author:   ram at macports.org
Date:     2009-09-09 05:59:24 -0700 (Wed, 09 Sep 2009)
Log Message:
-----------
python/py26-crypto: apply patch from upstream 269429, fixes #21223

Modified Paths:
--------------
    trunk/dports/python/py26-crypto/Portfile

Added Paths:
-----------
    trunk/dports/python/py26-crypto/files/
    trunk/dports/python/py26-crypto/files/patch-hash_modules.diff

Modified: trunk/dports/python/py26-crypto/Portfile
===================================================================
--- trunk/dports/python/py26-crypto/Portfile	2009-09-09 12:59:14 UTC (rev 57312)
+++ trunk/dports/python/py26-crypto/Portfile	2009-09-09 12:59:24 UTC (rev 57313)
@@ -5,6 +5,7 @@
 
 name             py26-crypto
 version          2.0.1
+revision         1
 categories       python security
 platforms        darwin freebsd
 maintainers      ram openmaintainer
@@ -22,6 +23,8 @@
                  sha1 c77cdefdfb06e4749690013a9a9e1600ab14e26f \
                  rmd160 5ce938a24f77f414e42680c17ef9b6dc8de94a2e
 
+patchfiles       patch-hash_modules.diff
+
 #test.run        yes
 #test.cmd        ${python.bin} test.py
 test.target

Added: trunk/dports/python/py26-crypto/files/patch-hash_modules.diff
===================================================================
--- trunk/dports/python/py26-crypto/files/patch-hash_modules.diff	                        (rev 0)
+++ trunk/dports/python/py26-crypto/files/patch-hash_modules.diff	2009-09-09 12:59:24 UTC (rev 57313)
@@ -0,0 +1,58 @@
+--- Hash/MD5.py
++++ Hash/MD5.py
+@@ -3,11 +3,21 @@
+ 
+ __revision__ = "$Id$"
+ 
+-from md5 import *
++__all__ = ['new', 'digest_size']
+ 
+-import md5
+-if hasattr(md5, 'digestsize'):
+-    digest_size = digestsize
+-    del digestsize
+-del md5
++try:
++    # The md5 module is deprecated in Python 2.6, so use hashlib when possible.
++    import hashlib
++    def new(data=""):
++        return hashlib.md5(data)
++    digest_size = new().digest_size
++
++except ImportError:
++    from md5 import *
++
++    import md5
++    if hasattr(md5, 'digestsize'):
++        digest_size = digestsize
++        del digestsize
++    del md5
+ 
+--- Hash/SHA.py
++++ Hash/SHA.py
+@@ -3,9 +3,19 @@
+ 
+ __revision__ = "$Id$"
+ 
+-from sha import *
+-import sha
+-if hasattr(sha, 'digestsize'):
+-    digest_size = digestsize
+-    del digestsize
+-del sha
++__all__ = ['new', 'digest_size']
++
++try:
++    # The md5 module is deprecated in Python 2.6, so use hashlib when possible.
++    import hashlib
++    def new(data=""):
++        return hashlib.sha1(data)
++    digest_size = new().digest_size
++
++except ImportError:
++    from sha import *
++    import sha
++    if hasattr(sha, 'digestsize'):
++        digest_size = digestsize
++        del digestsize
++    del sha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090909/b29d9ac3/attachment.html>


More information about the macports-changes mailing list