From: Zac Medico Date: Thu, 10 Jan 2013 07:54:26 +0000 (-0800) Subject: FetchIterator: support PORTAGE_CHECKSUM_FILTER X-Git-Tag: v2.2.0_alpha150~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f14f173934f11415889c114af24685bb2b19de22;p=portage.git FetchIterator: support PORTAGE_CHECKSUM_FILTER --- diff --git a/pym/portage/_emirrordist/FetchIterator.py b/pym/portage/_emirrordist/FetchIterator.py index 58044ac89..16a0b04c9 100644 --- a/pym/portage/_emirrordist/FetchIterator.py +++ b/pym/portage/_emirrordist/FetchIterator.py @@ -2,6 +2,8 @@ # Distributed under the terms of the GNU General Public License v2 from portage import os +from portage.checksum import (_apply_hash_filter, + _filter_unaccelarated_hashes, _hash_filter) from portage.dep import use_reduce from portage.exception import PortageException from .FetchTask import FetchTask @@ -28,6 +30,11 @@ class FetchIterator(object): file_failures = self._config.file_failures restrict_mirror_exemptions = self._config.restrict_mirror_exemptions + hash_filter = _hash_filter( + portdb.settings.get("PORTAGE_CHECKSUM_FILTER", "")) + if hash_filter.transparent: + hash_filter = None + for cp in self._iter_every_cp(): for tree in portdb.porttrees: @@ -125,6 +132,12 @@ class FetchIterator(object): continue file_owners[filename] = cpv + file_digests = \ + _filter_unaccelarated_hashes(file_digests) + if hash_filter is not None: + file_digests = _apply_hash_filter( + file_digests, hash_filter) + yield FetchTask(cpv=cpv, background=True, digests=file_digests,