Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH 02/14] portage.checksum: Remove python-fchksum support
Date: Sun, 12 Mar 2017 19:01:00
Message-Id: 20170312190011.3234-3-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCHES] portage.checksum hacking, pt. 4 by "Michał Górny"
1 Remove the support for MD5 implementation from python-fchksum package.
2 The package is rarely installed, supports Python 2.7 only and the code
3 handles checksumming a whole file only.
4 ---
5 pym/portage/checksum.py | 11 +----------
6 1 file changed, 1 insertion(+), 10 deletions(-)
7
8 diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
9 index 3e61acdec..9f88f7e65 100644
10 --- a/pym/portage/checksum.py
11 +++ b/pym/portage/checksum.py
12 @@ -19,7 +19,7 @@ import tempfile
13 # most preferred first. Please keep this in sync with logic below.
14 # ================================================================
15 #
16 -# MD5: python-fchksum, hashlib, mhash
17 +# MD5: hashlib, mhash
18 # SHA1: hashlib, mhash
19 # SHA256: hashlib, pycrypto, mhash
20 # SHA512: hashlib, mhash
21 @@ -186,15 +186,6 @@ if "WHIRLPOOL" not in hashfunc_map:
22 from portage.util.whirlpool import new as _new_whirlpool
23 whirlpoolhash = _generate_hash_function("WHIRLPOOL", _new_whirlpool, origin="bundled")
24
25 -# Use python-fchksum if available, prefer it over all other MD5 implementations
26 -try:
27 - from fchksum import fmd5t as md5hash
28 - hashfunc_map["MD5"] = md5hash
29 - hashorigin_map["MD5"] = "python-fchksum"
30 -
31 -except ImportError:
32 - pass
33 -
34 # There is only one implementation for size
35 def getsize(filename):
36 size = os.stat(filename).st_size
37 --
38 2.12.0