[56561] trunk/dports/tex/rubber

ram at macports.org ram at macports.org
Sat Aug 29 22:22:51 PDT 2009


Revision: 56561
          http://trac.macports.org/changeset/56561
Author:   ram at macports.org
Date:     2009-08-29 22:22:47 -0700 (Sat, 29 Aug 2009)
Log Message:
-----------
tex/rubber: use hashlib if available, removes deprecation warning on
python26 and higher

Modified Paths:
--------------
    trunk/dports/tex/rubber/Portfile

Added Paths:
-----------
    trunk/dports/tex/rubber/files/patch-src_util.py.diff

Modified: trunk/dports/tex/rubber/Portfile
===================================================================
--- trunk/dports/tex/rubber/Portfile	2009-08-30 05:09:10 UTC (rev 56560)
+++ trunk/dports/tex/rubber/Portfile	2009-08-30 05:22:47 UTC (rev 56561)
@@ -4,7 +4,7 @@
 
 name            rubber
 version         1.1
-revision        4
+revision        5
 patchfiles      patch-ab patch-ac
 categories      tex print
 maintainers     milosh openmaintainer
@@ -29,5 +29,8 @@
 configure.args  --python=${prefix}/bin/python \
                 --mandir=${destroot}${prefix}/share/man \
                 --infodir=${destroot}${prefix}/share/info
+
+patchfiles      patch-src_util.py.diff
+
 destroot.args   prefix=${destroot}${prefix}
 

Added: trunk/dports/tex/rubber/files/patch-src_util.py.diff
===================================================================
--- trunk/dports/tex/rubber/files/patch-src_util.py.diff	                        (rev 0)
+++ trunk/dports/tex/rubber/files/patch-src_util.py.diff	2009-08-30 05:22:47 UTC (rev 56561)
@@ -0,0 +1,26 @@
+--- src/util.py.org	2009-08-30 00:19:33.000000000 -0500
++++ src/util.py	2009-08-30 00:20:36.000000000 -0500
+@@ -5,7 +5,13 @@
+ by the modules for various tasks.
+ """
+ 
+-import md5
++try:
++	# use hashlib if available, python25 and above
++	from hashlib import md5
++except ImportError:
++	# md5 is deprecated in python26
++	from md5 import new as md5
++
+ import os, stat, time
+ import imp
+ import re, string
+@@ -19,7 +25,7 @@
+ 	"""
+ 	Compute the MD5 sum of a given file.
+ 	"""
+-	m = md5.new()
++	m = md5()
+ 	file = open(fname)
+ 	for line in file.readlines():
+ 		m.update(line)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090829/d243e8e6/attachment.html>


More information about the macports-changes mailing list