commit: 804bd357327e71bacef69b51ed9abbeb9a2c95a7
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 28 07:57:41 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Feb 28 22:07:09 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=804bd357
checksum: Add summary on top to help following the logic
Add a summary of all supported digest algorithms on top of the file
along with the supported implementations and their order of preference.
This will help people follow the crazy logic below.
pym/portage/checksum.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
index cdf467003..319252315 100644
--- a/pym/portage/checksum.py
+++ b/pym/portage/checksum.py
@@ -1,5 +1,5 @@
# checksum.py -- core Portage functionality
-# Copyright 1998-2014 Gentoo Foundation
+# Copyright 1998-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import portage
@@ -13,6 +13,19 @@ import stat
import subprocess
import tempfile
+
+# Summary of all available hashes and their implementations,
+# most preferred first. Please keep this in sync with logic below.
+# ================================================================
+#
+# MD5: python-fchksum, hashlib, mhash, hashlib/md5
+# SHA1: hashlib, mhash, hashlib/sha1
+# SHA256: hashlib, pycrypto, mhash
+# SHA512: hashlib, mhash
+# RMD160: hashlib, pycrypto, mhash
+# WHIRLPOOL: hashlib, mhash, bundled
+
+
#dict of all available hash functions
hashfunc_map = {}
hashorigin_map = {}