[133181] contrib/pypi2port/pypi2port.py

gaurav at macports.org gaurav at macports.org
Mon Feb 23 04:02:24 PST 2015


Revision: 133181
          https://trac.macports.org/changeset/133181
Author:   gaurav at macports.org
Date:     2015-02-23 04:02:24 -0800 (Mon, 23 Feb 2015)
Log Message:
-----------
contrib/pypi2port: Corrected the checksum verification and calucaltion using hashlib

Modified Paths:
--------------
    contrib/pypi2port/pypi2port.py

Modified: contrib/pypi2port/pypi2port.py
===================================================================
--- contrib/pypi2port/pypi2port.py	2015-02-23 11:59:53 UTC (rev 133180)
+++ contrib/pypi2port/pypi2port.py	2015-02-23 12:02:24 UTC (rev 133181)
@@ -124,14 +124,14 @@
 
 			pbar.finish()
 
-	# checksum_md5_calc = hashlib.md5(open(file_name).read()).hexdigest()
+	checksum_md5_calc = hashlib.md5(open(file_name,'rb').read()).hexdigest()
 	# print(file_name)
-	command = "openssl md5 "+file_name
-	command = command.split()
-	checksum_md5_calc = str(subprocess.check_output(command, stderr=subprocess.STDOUT)).split('=')[1][1:-3]
+	# sys.exit(1)
+	# command = "openssl md5 "+file_name
+	# command = command.split()
+	# checksum_md5_calc = str(subprocess.check_output(command, stderr=subprocess.STDOUT)).split('=')[1][1:-3]
 	# print(checksum_md5_calc)
 
-	# print(open(file_name).read())
 	if str(checksum_md5) == str(checksum_md5_calc):
 		print('Successfully fetched')
 		ext = file_name.split('.')[-1]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150223/8f1f9d7a/attachment.html>


More information about the macports-changes mailing list