@@ -, +, @@ --- pym/portage/const.py | 1 + pym/portage/package/ebuild/fetch.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) --- a/pym/portage/const.py +++ a/pym/portage/const.py @@ -148,6 +148,7 @@ SUPPORTED_FEATURES = frozenset([ "force-mirror", "force-prefix", "getbinpkg", + "gentoo-mirrors-shuffle", "icecream", "installsources", "ipc-sandbox", --- a/pym/portage/package/ebuild/fetch.py +++ a/pym/portage/package/ebuild/fetch.py @@ -364,7 +364,13 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, pass else: if try_mirrors: - mymirrors += [x.rstrip("/") for x in mysettings["GENTOO_MIRRORS"].split() if x] + if 'gentoo-mirrors-shuffle' in mysettings["FEATURES"]: + shuffled_mirrors = [x.rstrip("/") for x in mysettings["GENTOO_MIRRORS"].split() if x] + random.shuffle(shuffled_mirrors) + mymirrors += shuffled_mirrors + del shuffled_mirrors + else: + mymirrors += [x.rstrip("/") for x in mysettings["GENTOO_MIRRORS"].split() if x] hash_filter = _hash_filter(mysettings.get("PORTAGE_CHECKSUM_FILTER", "")) if hash_filter.transparent: --