From f14f173934f11415889c114af24685bb2b19de22 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 9 Jan 2013 23:54:26 -0800 Subject: FetchIterator: support PORTAGE_CHECKSUM_FILTER --- pym/portage/_emirrordist/FetchIterator.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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, -- cgit v1.2.3-1-g7c22