Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: pym/portage/package/ebuild/fetch.py

Issue 6677171: Add force-mirror FEATURE. (Closed) Base URL: http://git.chromium.org/git/portage_tool.git@cros-2.1.9
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pym/portage/const.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pym/portage/package/ebuild/fetch.py
diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py
index c33375ca6afca6fb70f482dc5cea8b550f527449..6e4c728ec27b48872b53d158a7d356566ab973fc 100644
--- a/pym/portage/package/ebuild/fetch.py
+++ b/pym/portage/package/ebuild/fetch.py
@@ -245,8 +245,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
userpriv = secpass >= 2 and "userpriv" in features
# 'nomirror' is bad/negative logic. You Restrict mirroring, not no-mirroring.
- if "mirror" in restrict or \
- "nomirror" in restrict:
+ restrict_mirror = "mirror" in restrict or "nomirror" in restrict
+ if restrict_mirror:
if ("mirror" in features) and ("lmirror" not in features):
# lmirror should allow you to bypass mirror restrictions.
# XXX: This is not a good thing, and is temporary at best.
@@ -344,8 +344,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
if "local" in custommirrors:
mymirrors += custommirrors["local"]
- if "nomirror" in restrict or \
- "mirror" in restrict:
+ if restrict_mirror:
# We don't add any mirrors.
pass
else:
@@ -374,6 +373,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
del mymirrors[x]
restrict_fetch = "fetch" in restrict
+ force_mirror = "force-mirror" in features and not restrict_mirror
custom_local_mirrors = custommirrors.get("local", [])
if restrict_fetch:
# With fetch restriction, a normal uri may only be fetched from
@@ -430,7 +430,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
writemsg(_("Invalid mirror definition in SRC_URI:\n"), noiselevel=-1)
writemsg(" %s\n" % (myuri), noiselevel=-1)
else:
- if restrict_fetch:
+ if restrict_fetch or force_mirror:
# Only fetch from specific mirrors is allowed.
continue
if "primaryuri" in restrict:
« no previous file with comments | « pym/portage/const.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698