aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Smith <matthew@gentoo.org>2022-02-15 20:11:08 +0000
committerMatthew Smith <matthew@gentoo.org>2022-02-16 18:02:16 +0000
commitaec6c83e31a883f9777198b45e8356660afb35d4 (patch)
treeabb39708d0f49b850edf13719b3089d0d136d7f0 /ebuild-writing
parentdevbook.rnc: Change from DTD to RELAX NG compact schema (diff)
downloaddevmanual-aec6c83e31a883f9777198b45e8356660afb35d4.tar.gz
devmanual-aec6c83e31a883f9777198b45e8356660afb35d4.tar.bz2
devmanual-aec6c83e31a883f9777198b45e8356660afb35d4.zip
ebuild-writing/variables: Selectively lifting SRC_URI restrictions
Closes: https://github.com/gentoo/devmanual/pull/271 Signed-off-by: Matthew Smith <matthew@gentoo.org>
Diffstat (limited to 'ebuild-writing')
-rw-r--r--ebuild-writing/variables/text.xml62
1 files changed, 61 insertions, 1 deletions
diff --git a/ebuild-writing/variables/text.xml b/ebuild-writing/variables/text.xml
index e45794d..41976b2 100644
--- a/ebuild-writing/variables/text.xml
+++ b/ebuild-writing/variables/text.xml
@@ -431,7 +431,6 @@ SRC_URI="https://example.com/files/${PV}.tar.gz -&gt; ${P}.tar.gz"
</body>
</subsection>
-
<subsection>
<title>Third-party mirrors</title>
<body>
@@ -488,6 +487,67 @@ list does not outweigh the burden of maintaining it.
</body>
</subsection>
+
+
+<subsection>
+<title>Lifting restrictions</title>
+<body>
+
+<p>
+In EAPI 8, individual items in <c>SRC_URI</c> can be exempted from automatic
+mirroring and fetching restrictions (imposed by <c>RESTRICT="mirror"</c> and
+<c>RESTRICT="fetch"</c>) by prefixing the addresses with <c>mirror+</c> or
+<c>fetch+</c>. For example, in the following ebuild,
+</p>
+
+<codesample lang="ebuild">
+EAPI="8"
+
+SRC_URI="${P}.tar.gz
+ mirror+https://dev.gentoo.org/~larry/distfiles/${P}-addons.tar.gz"
+
+RESTRICT="fetch"
+</codesample>
+
+<p>
+Portage will be prevented from trying to fetch <c>${P}.tar.gz</c> as expected,
+but the <c>${P}-patches.tar.gz</c> file will be mirrored and fetched by Portage
+without restriction.
+</p>
+
+<p>
+The following table shows the effects of the prefixes when <c>RESTRICT="mirror"</c> and <c>RESTRICT="fetch"</c> are set:
+</p>
+
+<table>
+<tr>
+ <th></th>
+ <th><e>(no prefix)</e></th>
+ <th><c>fetch+</c></th>
+ <th><c>mirror+</c></th>
+</tr>
+<tr>
+ <th><e>(no RESTRICT)</e></th>
+ <ti>fetch &amp; mirror</ti>
+ <ti>fetch &amp; mirror</ti>
+ <ti>fetch &amp; mirror</ti>
+</tr>
+<tr>
+ <th><c>RESTRICT="mirror"</c></th>
+ <ti>fetch only</ti>
+ <ti>fetch only</ti>
+ <ti>fetch &amp; mirror</ti>
+</tr>
+<tr>
+ <th><c>RESTRICT="fetch"</c></th>
+ <ti>unfetchable</ti>
+ <ti>fetch only</ti>
+ <ti>fetch &amp; mirror</ti>
+</tr>
+</table>
+
+</body>
+</subsection>
</section>
<section>