From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 79355139694 for ; Tue, 28 Feb 2017 22:07:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8DF27E0C7C; Tue, 28 Feb 2017 22:07:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 665F2E0C75 for ; Tue, 28 Feb 2017 22:07:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4201434169D for ; Tue, 28 Feb 2017 22:07:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0B54B57F6 for ; Tue, 28 Feb 2017 22:07:16 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1488319629.804bd357327e71bacef69b51ed9abbeb9a2c95a7.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/checksum.py X-VCS-Directories: pym/portage/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 804bd357327e71bacef69b51ed9abbeb9a2c95a7 X-VCS-Branch: master Date: Tue, 28 Feb 2017 22:07:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b19ac3a4-5b98-421b-890d-4e1660307a78 X-Archives-Hash: 5db8d0f43ee6bab6a6f393749d56a9cf commit: 804bd357327e71bacef69b51ed9abbeb9a2c95a7 Author: Michał Górny gentoo org> AuthorDate: Tue Feb 28 07:57:41 2017 +0000 Commit: Michał Górny gentoo 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 = {}