diff options
author | Zac Medico <zmedico@gentoo.org> | 2013-01-09 23:54:26 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2013-01-09 23:54:26 -0800 |
commit | f14f173934f11415889c114af24685bb2b19de22 (patch) | |
tree | 995ee0be4e7f859d8b0f3856aaf59152761628ea | |
parent | 51d27450460126b40d9416327b50316e4794c205 (diff) | |
download | portage-f14f173934f11415889c114af24685bb2b19de22.tar.gz portage-f14f173934f11415889c114af24685bb2b19de22.tar.bz2 portage-f14f173934f11415889c114af24685bb2b19de22.zip |
FetchIterator: support PORTAGE_CHECKSUM_FILTER
-rw-r--r-- | pym/portage/_emirrordist/FetchIterator.py | 13 |
1 files changed, 13 insertions, 0 deletions
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, |