Index: sys-apps/portage/files/portage-2.1.9.45-force-mirror.patch |
diff --git a/sys-apps/portage/files/portage-2.1.9.45-force-mirror.patch b/sys-apps/portage/files/portage-2.1.9.45-force-mirror.patch |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1ad5e31e9b64dc5d3c2b76ba04f56d261edead87 |
--- /dev/null |
+++ b/sys-apps/portage/files/portage-2.1.9.45-force-mirror.patch |
@@ -0,0 +1,90 @@ |
+commit f82701bbebfadd889106dc46b6c7bf862c167b18 |
+Author: Zac Medico <zmedico@gentoo.org> |
+Date: Tue Apr 5 15:23:28 2011 -0700 |
+ |
+ Add force-mirror FEATURE. |
+ |
+ force-mirror: Only fetch files from configured mirrors, ignoring |
+ SRC_URI, except when mirror is in the ebuild(5) RESTRICT variable. |
+ |
+ BUG=chromium-os:13221 |
+ TEST=Test that ebuilds now fail with FEATURES=force-mirror if files are |
+ not in the configured mirror. |
+ |
+ Change-Id: I8484d5af8dff97b431398030b33c024ff1295ba0 |
+ |
+ Review URL: http://codereview.chromium.org/6677171 |
+ (cherry picked from commit 1944622240d87dfa90d88ba19d68f023eed9949f) |
+ |
+diff --git a/man/make.conf.5 b/man/make.conf.5 |
+index 6a1fdd3..cbc007ff 100644 |
+--- a/man/make.conf.5 |
++++ b/man/make.conf.5 |
+@@ -304,6 +304,10 @@ enabled for more than a short period of time. |
+ Modifies .la files to not include other .la files and some other |
+ fixes (order of flags, duplicated entries, ...) |
+ .TP |
++.B force\-mirror |
++Only fetch files from configured mirrors, ignoring \fBSRC_URI\fR, |
++except when \fImirror\fR is in the \fBebuild\fR(5) \fBRESTRICT\fR variable. |
++.TP |
+ .B lmirror |
+ When \fImirror\fR is enabled in \fBFEATURES\fR, fetch files even |
+ when \fImirror\fR is also in the \fBebuild\fR(5) \fBRESTRICT\fR variable. |
+diff --git a/pym/portage/const.py b/pym/portage/const.py |
+index b2d2f77..34b02fc 100644 |
+--- a/pym/portage/const.py |
++++ b/pym/portage/const.py |
+@@ -88,8 +88,8 @@ EBUILD_PHASES = ("pretend", "setup", "unpack", "prepare", "configure" |
+ SUPPORTED_FEATURES = frozenset([ |
+ "assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy", |
+ "ccache", "chflags", "collision-protect", "compress-build-logs", |
+- "digest", "distcc", "distlocks", |
+- "fakeroot", "fail-clean", "fixpackages", "getbinpkg", |
++ "digest", "distcc", "distlocks", "fakeroot", |
++ "fail-clean", "fixpackages", "force-mirror", "getbinpkg", |
+ "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror", |
+ "metadata-transfer", "mirror", "multilib-strict", "news", |
+ "noauto", "noclean", "nodoc", "noinfo", "noman", "nostrip", |
+diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py |
+index c33375c..6e4c728 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: |