<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd-->
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head><title>Package Manager Specification</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)" />
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)" />
<!-- xhtml,fn-in,charset=utf-8,html -->
<meta name="src" content="pms.tex" />
<link rel="stylesheet" type="text/css" href="pms.css" />
</head><body
>
<div class="maketitle">
<h2 class="titleHead">Package Manager Specification</h2>
<div class="author" ><span
class="ecrm-1200">Stephen P. Bennett</span>
<br /> <a
href="mailto:spb@exherbo.org" ><span
class="ecrm-1200">spb@exherbo.org</span></a> <br class="and" /><span
class="ecrm-1200">Christian Faulhammer</span>
<br /> <a
href="mailto:fauli@gentoo.org" ><span
class="ecrm-1200">fauli@gentoo.org</span></a> <br class="and" /><span
class="ecrm-1200">Ciaran McCreesh</span>
<br /> <a
href="mailto:ciaran.mccreesh@googlemail.com" ><span
class="ecrm-1200">ciaran.mccreesh@googlemail.com</span></a> <br class="and" /><span
class="ecrm-1200">Ulrich Müller</span>
<br /> <a
href="mailto:ulm@gentoo.org" ><span
class="ecrm-1200">ulm@gentoo.org</span></a> </div>
<br />
<div class="date" ><span
class="ecrm-1200">13th June 2021</span></div>
</div>
<!--l. 34--><p class="noindent" ><span
class="tcrm-0900">© </span><span
class="ecrm-0900">2007–2021 Stephen Bennett, Ciaran McCreesh and others. Contributions are owned by their respective</span>
<span
class="ecrm-0900">authors, and may have been changed substantially before inclusion.</span>
</p><!--l. 37--><p class="noindent" ><span
class="ecrm-0900">This work is released under the Creative Commons Attribution-ShareAlike 4.0 International Licence.</span>
<span
class="ecrm-0900">To view a copy of this licence, visit </span><a
href="https://creativecommons.org/licenses/by-sa/4.0/" class="url" ><span
class="ectt-0900">https://creativecommons.org/licenses/by-sa/4.0/</span></a><span
class="ecrm-0900">.</span>
</p><!--l. 41--><p class="noindent" ><span
class="ecrm-0900">This version corresponds to commit 06af57d.</span>
</p>
<h2 class="likechapterHead"><a
id="x1-1000"></a>Contents</h2>
<div class="tableofcontents">
<span class="chapterToc" >1 <a
href="#x1-50001" id="QQ2-1-5">Introduction</a></span>
<br /> <span class="sectionToc" >1.1 <a
href="#x1-60001.1" id="QQ2-1-6">Aims and Motivation</a></span>
<br /> <span class="sectionToc" >1.2 <a
href="#x1-70001.2" id="QQ2-1-7">Rationale</a></span>
<br /> <span class="sectionToc" >1.3 <a
href="#x1-80001.3" id="QQ2-1-8">Reporting Issues</a></span>
<br /> <span class="sectionToc" >1.4 <a
href="#x1-90001.4" id="QQ2-1-9">Conventions</a></span>
<br /> <span class="sectionToc" >1.5 <a
href="#x1-100001.5" id="QQ2-1-10">Acknowledgements</a></span>
<br /><span class="chapterToc" >2 <a
href="#x1-110002" id="QQ2-1-11">EAPIs</a></span>
<br /> <span class="sectionToc" >2.1 <a
href="#x1-120002.1" id="QQ2-1-12">Definition</a></span>
<br /> <span class="sectionToc" >2.2 <a
href="#x1-130002.2" id="QQ2-1-13">Defined EAPIs</a></span>
<br /> <span class="sectionToc" >2.3 <a
href="#x1-140002.3" id="QQ2-1-14">Reserved EAPIs</a></span>
<br /><span class="chapterToc" >3 <a
href="#x1-150003" id="QQ2-1-15">Names and Versions</a></span>
<br /> <span class="sectionToc" >3.1 <a
href="#x1-160003.1" id="QQ2-1-16">Restrictions upon Names</a></span>
<br /> <span class="subsectionToc" >3.1.1 <a
href="#x1-170003.1.1" id="QQ2-1-17">Category names</a></span>
<br /> <span class="subsectionToc" >3.1.2 <a
href="#x1-180003.1.2" id="QQ2-1-18">Package names</a></span>
<br /> <span class="subsectionToc" >3.1.3 <a
href="#x1-190003.1.3" id="QQ2-1-19">Slot names</a></span>
<br /> <span class="subsectionToc" >3.1.4 <a
href="#x1-200003.1.4" id="QQ2-1-20">USE flag names</a></span>
<br /> <span class="subsectionToc" >3.1.5 <a
href="#x1-210003.1.5" id="QQ2-1-21">Repository names</a></span>
<br /> <span class="subsectionToc" >3.1.6 <a
href="#x1-220003.1.6" id="QQ2-1-22">License names</a></span>
<br /> <span class="subsectionToc" >3.1.7 <a
href="#x1-230003.1.7" id="QQ2-1-23">Keyword names</a></span>
<br /> <span class="subsectionToc" >3.1.8 <a
href="#x1-240003.1.8" id="QQ2-1-24">EAPI names</a></span>
<br /> <span class="sectionToc" >3.2 <a
href="#x1-250003.2" id="QQ2-1-25">Version Specifications</a></span>
<br /> <span class="sectionToc" >3.3 <a
href="#x1-260003.3" id="QQ2-1-26">Version Comparison</a></span>
<br /> <span class="sectionToc" >3.4 <a
href="#x1-270003.4" id="QQ2-1-34">Uniqueness of Versions</a></span>
<br /><span class="chapterToc" >4 <a
href="#x1-280004" id="QQ2-1-35">Tree Layout</a></span>
<br /> <span class="sectionToc" >4.1 <a
href="#x1-290004.1" id="QQ2-1-36">Top Level</a></span>
<br /> <span class="sectionToc" >4.2 <a
href="#x1-300004.2" id="QQ2-1-37">Category Directories</a></span>
<br /> <span class="sectionToc" >4.3 <a
href="#x1-310004.3" id="QQ2-1-38">Package Directories</a></span>
<br /> <span class="sectionToc" >4.4 <a
href="#x1-320004.4" id="QQ2-1-39">The Profiles Directory</a></span>
<br /> <span class="subsectionToc" >4.4.1 <a
href="#x1-330004.4.1" id="QQ2-1-41">The profiles.desc file</a></span>
<br /> <span class="subsectionToc" >4.4.2 <a
href="#x1-340004.4.2" id="QQ2-1-42">The thirdpartymirrors file</a></span>
<br /> <span class="subsectionToc" >4.4.3 <a
href="#x1-350004.4.3" id="QQ2-1-43">use.desc and related files</a></span>
<br /> <span class="subsectionToc" >4.4.4 <a
href="#x1-360004.4.4" id="QQ2-1-44">The updates directory</a></span>
<br /> <span class="sectionToc" >4.5 <a
href="#x1-370004.5" id="QQ2-1-46">The Licenses Directory</a></span>
<br /> <span class="sectionToc" >4.6 <a
href="#x1-380004.6" id="QQ2-1-47">The Eclass Directory</a></span>
<br /> <span class="sectionToc" >4.7 <a
href="#x1-390004.7" id="QQ2-1-48">The Metadata Directory</a></span>
<br /> <span class="subsectionToc" >4.7.1 <a
href="#x1-400004.7.1" id="QQ2-1-49">The metadata cache</a></span>
<br /><span class="chapterToc" >5 <a
href="#x1-410005" id="QQ2-1-50">Profiles</a></span>
<br /> <span class="sectionToc" >5.1 <a
href="#x1-420005.1" id="QQ2-1-51">General Principles</a></span>
<br /> <span class="sectionToc" >5.2 <a
href="#x1-430005.2" id="QQ2-1-52">Files That Make up a Profile</a></span>
<br /> <span class="subsectionToc" >5.2.1 <a
href="#x1-440005.2.1" id="QQ2-1-53">The parent file</a></span>
<br /> <span class="subsectionToc" >5.2.2 <a
href="#x1-450005.2.2" id="QQ2-1-54">The eapi file</a></span>
<br /> <span class="subsectionToc" >5.2.3 <a
href="#x1-460005.2.3" id="QQ2-1-55">deprecated</a></span>
<br /> <span class="subsectionToc" >5.2.4 <a
href="#x1-470005.2.4" id="QQ2-1-56">make.defaults</a></span>
<br /> <span class="subsectionToc" >5.2.5 <a
href="#x1-480005.2.5" id="QQ2-1-57">Simple line-based files</a></span>
<br /> <span class="subsectionToc" >5.2.6 <a
href="#x1-490005.2.6" id="QQ2-1-59">packages</a></span>
<br /> <span class="subsectionToc" >5.2.7 <a
href="#x1-500005.2.7" id="QQ2-1-60">packages.build</a></span>
<br /> <span class="subsectionToc" >5.2.8 <a
href="#x1-510005.2.8" id="QQ2-1-61">package.mask</a></span>
<br /> <span class="subsectionToc" >5.2.9 <a
href="#x1-520005.2.9" id="QQ2-1-62">package.provided</a></span>
<br /> <span class="subsectionToc" >5.2.10 <a
href="#x1-530005.2.10" id="QQ2-1-64">package.use</a></span>
<br /> <span class="subsectionToc" >5.2.11 <a
href="#x1-540005.2.11" id="QQ2-1-65">USE masking and forcing</a></span>
<br /> <span class="sectionToc" >5.3 <a
href="#x1-550005.3" id="QQ2-1-68">Profile Variables</a></span>
<br /> <span class="subsectionToc" >5.3.1 <a
href="#x1-560005.3.1" id="QQ2-1-69">Incremental variables</a></span>
<br /> <span class="subsectionToc" >5.3.2 <a
href="#x1-570005.3.2" id="QQ2-1-72">Specific variables and their meanings</a></span>
<br /><span class="chapterToc" >6 <a
href="#x1-580006" id="QQ2-1-73">Ebuild File Format</a></span>
<br /><span class="chapterToc" >7 <a
href="#x1-590007" id="QQ2-1-75">Ebuild-defined Variables</a></span>
<br /> <span class="sectionToc" >7.1 <a
href="#x1-600007.1" id="QQ2-1-76">Metadata Invariance</a></span>
<br /> <span class="sectionToc" >7.2 <a
href="#x1-610007.2" id="QQ2-1-77">Mandatory Ebuild-defined Variables</a></span>
<br /> <span class="sectionToc" >7.3 <a
href="#x1-620007.3" id="QQ2-1-78">Optional Ebuild-defined Variables</a></span>
<br /> <span class="subsectionToc" >7.3.1 <a
href="#x1-630007.3.1" id="QQ2-1-81">EAPI</a></span>
<br /> <span class="subsectionToc" >7.3.2 <a
href="#x1-640007.3.2" id="QQ2-1-82">SRC_URI</a></span>
<br /> <span class="subsectionToc" >7.3.3 <a
href="#x1-650007.3.3" id="QQ2-1-84">Keywords</a></span>
<br /> <span class="subsectionToc" >7.3.4 <a
href="#x1-660007.3.4" id="QQ2-1-85">USE state constraints</a></span>
<br /> <span class="subsectionToc" >7.3.5 <a
href="#x1-670007.3.5" id="QQ2-1-86">Properties</a></span>
<br /> <span class="subsectionToc" >7.3.6 <a
href="#x1-680007.3.6" id="QQ2-1-87">Restrict</a></span>
<br /> <span class="subsectionToc" >7.3.7 <a
href="#x1-690007.3.7" id="QQ2-1-88">RDEPEND value</a></span>
<br /> <span class="sectionToc" >7.4 <a
href="#x1-700007.4" id="QQ2-1-90">Magic Ebuild-defined Variables</a></span>
<br /><span class="chapterToc" >8 <a
href="#x1-710008" id="QQ2-1-92">Dependencies</a></span>
<br /> <span class="sectionToc" >8.1 <a
href="#x1-720008.1" id="QQ2-1-93">Dependency Classes</a></span>
<br /> <span class="sectionToc" >8.2 <a
href="#x1-730008.2" id="QQ2-1-98">Dependency Specification Format</a></span>
<br /> <span class="subsectionToc" >8.2.1 <a
href="#x1-740008.2.1" id="QQ2-1-100">All-of dependency specifications</a></span>
<br /> <span class="subsectionToc" >8.2.2 <a
href="#x1-750008.2.2" id="QQ2-1-101">USE-conditional dependency specifications</a></span>
<br /> <span class="subsectionToc" >8.2.3 <a
href="#x1-760008.2.3" id="QQ2-1-102">Any-of dependency specifications</a></span>
<br /> <span class="subsectionToc" >8.2.4 <a
href="#x1-770008.2.4" id="QQ2-1-103">Exactly-one-of dependency specifications</a></span>
<br /> <span class="subsectionToc" >8.2.5 <a
href="#x1-780008.2.5" id="QQ2-1-105">At-most-one-of dependency specifications</a></span>
<br /> <span class="sectionToc" >8.3 <a
href="#x1-790008.3" id="QQ2-1-106">Package Dependency Specifications</a></span>
<br /> <span class="subsectionToc" >8.3.1 <a
href="#x1-800008.3.1" id="QQ2-1-109">Operators</a></span>
<br /> <span class="subsectionToc" >8.3.2 <a
href="#x1-810008.3.2" id="QQ2-1-110">Block operator</a></span>
<br /> <span class="subsectionToc" >8.3.3 <a
href="#x1-820008.3.3" id="QQ2-1-112">Slot dependencies</a></span>
<br /> <span class="subsectionToc" >8.3.4 <a
href="#x1-830008.3.4" id="QQ2-1-113">2-style and 4-style USE dependencies</a></span>
<br /><span class="chapterToc" >9 <a
href="#x1-840009" id="QQ2-1-114">Ebuild-defined Functions</a></span>
<br /> <span class="sectionToc" >9.1 <a
href="#x1-850009.1" id="QQ2-1-115">List of Functions</a></span>
<br /> <span class="subsectionToc" >9.1.1 <a
href="#x1-860009.1.1" id="QQ2-1-116">Initial working directories</a></span>
<br /> <span class="subsectionToc" >9.1.2 <a
href="#x1-870009.1.2" id="QQ2-1-119">pkg_pretend</a></span>
<br /> <span class="subsectionToc" >9.1.3 <a
href="#x1-880009.1.3" id="QQ2-1-121">pkg_setup</a></span>
<br /> <span class="subsectionToc" >9.1.4 <a
href="#x1-890009.1.4" id="QQ2-1-122">src_unpack</a></span>
<br /> <span class="subsectionToc" >9.1.5 <a
href="#x1-900009.1.5" id="QQ2-1-124">src_prepare</a></span>
<br /> <span class="subsectionToc" >9.1.6 <a
href="#x1-910009.1.6" id="QQ2-1-128">src_configure</a></span>
<br /> <span class="subsectionToc" >9.1.7 <a
href="#x1-920009.1.7" id="QQ2-1-131">src_compile</a></span>
<br /> <span class="subsectionToc" >9.1.8 <a
href="#x1-930009.1.8" id="QQ2-1-136">src_test</a></span>
<br /> <span class="subsectionToc" >9.1.9 <a
href="#x1-940009.1.9" id="QQ2-1-138">src_install</a></span>
<br /> <span class="subsectionToc" >9.1.10 <a
href="#x1-950009.1.10" id="QQ2-1-142">pkg_preinst</a></span>
<br /> <span class="subsectionToc" >9.1.11 <a
href="#x1-960009.1.11" id="QQ2-1-143">pkg_postinst</a></span>
<br /> <span class="subsectionToc" >9.1.12 <a
href="#x1-970009.1.12" id="QQ2-1-144">pkg_prerm</a></span>
<br /> <span class="subsectionToc" >9.1.13 <a
href="#x1-980009.1.13" id="QQ2-1-145">pkg_postrm</a></span>
<br /> <span class="subsectionToc" >9.1.14 <a
href="#x1-990009.1.14" id="QQ2-1-146">pkg_config</a></span>
<br /> <span class="subsectionToc" >9.1.15 <a
href="#x1-1000009.1.15" id="QQ2-1-147">pkg_info</a></span>
<br /> <span class="subsectionToc" >9.1.16 <a
href="#x1-1010009.1.16" id="QQ2-1-149">pkg_nofetch</a></span>
<br /> <span class="subsectionToc" >9.1.17 <a
href="#x1-1020009.1.17" id="QQ2-1-150">Default phase functions</a></span>
<br /> <span class="sectionToc" >9.2 <a
href="#x1-1030009.2" id="QQ2-1-152">Call Order</a></span>
<br /><span class="chapterToc" >10 <a
href="#x1-10400010" id="QQ2-1-153">Eclasses</a></span>
<br /> <span class="sectionToc" >10.1 <a
href="#x1-10500010.1" id="QQ2-1-154">The inherit Command</a></span>
<br /> <span class="sectionToc" >10.2 <a
href="#x1-10600010.2" id="QQ2-1-155">Eclass-defined Metadata Keys</a></span>
<br /> <span class="sectionToc" >10.3 <a
href="#x1-10700010.3" id="QQ2-1-157">EXPORT_FUNCTIONS</a></span>
<br /><span class="chapterToc" >11 <a
href="#x1-10800011" id="QQ2-1-159">The Ebuild Environment</a></span>
<br /> <span class="sectionToc" >11.1 <a
href="#x1-10900011.1" id="QQ2-1-160">Defined Variables</a></span>
<br /> <span class="subsectionToc" >11.1.1 <a
href="#x1-11000011.1.1" id="QQ2-1-166">USE and IUSE handling</a></span>
<br /> <span class="subsectionToc" >11.1.2 <a
href="#x1-11100011.1.2" id="QQ2-1-167">REPLACING_VERSIONS and REPLACED_BY_VERSION</a></span>
<br /> <span class="subsectionToc" >11.1.3 <a
href="#x1-11200011.1.3" id="QQ2-1-168">Offset-prefix variables</a></span>
<br /> <span class="subsectionToc" >11.1.4 <a
href="#x1-11300011.1.4" id="QQ2-1-170">Path variables and trailing slash</a></span>
<br /> <span class="sectionToc" >11.2 <a
href="#x1-11400011.2" id="QQ2-1-172">The State of Variables Between Functions</a></span>
<br /> <span class="sectionToc" >11.3 <a
href="#x1-11500011.3" id="QQ2-1-174">The State of the System Between Functions</a></span>
<br /><span class="chapterToc" >12 <a
href="#x1-11600012" id="QQ2-1-175">Available Commands</a></span>
<br /> <span class="sectionToc" >12.1 <a
href="#x1-11700012.1" id="QQ2-1-176">System Commands</a></span>
<br /> <span class="subsectionToc" >12.1.1 <a
href="#x1-11800012.1.1" id="QQ2-1-177">Guaranteed system commands</a></span>
<br /> <span class="sectionToc" >12.2 <a
href="#x1-11900012.2" id="QQ2-1-179">Commands Provided by Package Dependencies</a></span>
<br /> <span class="sectionToc" >12.3 <a
href="#x1-12000012.3" id="QQ2-1-180">Ebuild-specific Commands</a></span>
<br /> <span class="subsectionToc" >12.3.1 <a
href="#x1-12100012.3.1" id="QQ2-1-181">Failure behaviour and related commands</a></span>
<br /> <span class="subsectionToc" >12.3.2 <a
href="#x1-12200012.3.2" id="QQ2-1-183">Banned commands</a></span>
<br /> <span class="subsectionToc" >12.3.3 <a
href="#x1-12300012.3.3" id="QQ2-1-185">Sandbox commands</a></span>
<br /> <span class="subsectionToc" >12.3.4 <a
href="#x1-12400012.3.4" id="QQ2-1-186">Package manager query commands</a></span>
<br /> <span class="subsectionToc" >12.3.5 <a
href="#x1-12500012.3.5" id="QQ2-1-188">Output commands</a></span>
<br /> <span class="subsectionToc" >12.3.6 <a
href="#x1-12600012.3.6" id="QQ2-1-190">Error commands</a></span>
<br /> <span class="subsectionToc" >12.3.7 <a
href="#x1-12700012.3.7" id="QQ2-1-192">Patch commands</a></span>
<br /> <span class="subsectionToc" >12.3.8 <a
href="#x1-12800012.3.8" id="QQ2-1-195">Build commands</a></span>
<br /> <span class="subsectionToc" >12.3.9 <a
href="#x1-12900012.3.9" id="QQ2-1-199">Installation commands</a></span>
<br /> <span class="subsectionToc" >12.3.10 <a
href="#x1-13000012.3.10" id="QQ2-1-209">Commands affecting install destinations</a></span>
<br /> <span class="subsectionToc" >12.3.11 <a
href="#x1-13100012.3.11" id="QQ2-1-212">Commands controlling manipulation of files in the staging area</a></span>
<br /> <span class="subsectionToc" >12.3.12 <a
href="#x1-13200012.3.12" id="QQ2-1-214">USE list functions</a></span>
<br /> <span class="subsectionToc" >12.3.13 <a
href="#x1-13300012.3.13" id="QQ2-1-218">Text list functions</a></span>
<br /> <span class="subsectionToc" >12.3.14 <a
href="#x1-13400012.3.14" id="QQ2-1-219">Version manipulation and comparison commands</a></span>
<br /> <span class="subsectionToc" >12.3.15 <a
href="#x1-13500012.3.15" id="QQ2-1-221">Misc commands</a></span>
<br /> <span class="subsectionToc" >12.3.16 <a
href="#x1-13600012.3.16" id="QQ2-1-227">Debug commands</a></span>
<br /> <span class="subsectionToc" >12.3.17 <a
href="#x1-13700012.3.17" id="QQ2-1-228">Reserved commands and variables</a></span>
<br /><span class="chapterToc" >13 <a
href="#x1-13800013" id="QQ2-1-229">Merging and Unmerging</a></span>
<br /> <span class="sectionToc" >13.1 <a
href="#x1-13900013.1" id="QQ2-1-230">Overview</a></span>
<br /> <span class="sectionToc" >13.2 <a
href="#x1-14000013.2" id="QQ2-1-231">Directories</a></span>
<br /> <span class="subsectionToc" >13.2.1 <a
href="#x1-14100013.2.1" id="QQ2-1-232">Permissions</a></span>
<br /> <span class="subsectionToc" >13.2.2 <a
href="#x1-14200013.2.2" id="QQ2-1-233">Empty directories</a></span>
<br /> <span class="sectionToc" >13.3 <a
href="#x1-14300013.3" id="QQ2-1-234">Regular Files</a></span>
<br /> <span class="subsectionToc" >13.3.1 <a
href="#x1-14400013.3.1" id="QQ2-1-235">Permissions</a></span>
<br /> <span class="subsectionToc" >13.3.2 <a
href="#x1-14500013.3.2" id="QQ2-1-236">File modification times</a></span>
<br /> <span class="subsectionToc" >13.3.3 <a
href="#x1-14600013.3.3" id="QQ2-1-238">Configuration file protection</a></span>
<br /> <span class="sectionToc" >13.4 <a
href="#x1-14700013.4" id="QQ2-1-239">Symlinks</a></span>
<br /> <span class="subsectionToc" >13.4.1 <a
href="#x1-14800013.4.1" id="QQ2-1-240">Rewriting</a></span>
<br /> <span class="sectionToc" >13.5 <a
href="#x1-14900013.5" id="QQ2-1-241">Hard Links</a></span>
<br /> <span class="sectionToc" >13.6 <a
href="#x1-15000013.6" id="QQ2-1-242">Other Files</a></span>
<br /><span class="chapterToc" >14 <a
href="#x1-15100014" id="QQ2-1-243">Metadata Cache</a></span>
<br /> <span class="sectionToc" >14.1 <a
href="#x1-15200014.1" id="QQ2-1-244">Directory Contents</a></span>
<br /> <span class="sectionToc" >14.2 <a
href="#x1-15300014.2" id="QQ2-1-245">Cache File Format</a></span>
<br /><span class="chapterToc" >15 <a
href="#x1-15400015" id="QQ2-1-246">Glossary</a></span>
<br /><span class="chapterToc" > <a
href="#Q1-1-248">Bibliography</a></span>
<br /><span class="appendixToc" >A <a
href="#x1-156000A" id="QQ2-1-249">metadata.xml</a></span>
<br /><span class="appendixToc" >B <a
href="#x1-157000B" id="QQ2-1-250">Unspecified Items</a></span>
<br /><span class="appendixToc" >C <a
href="#x1-158000C" id="QQ2-1-251">Historical Curiosities</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-159000C" id="QQ2-1-252">Long-obsolete Features</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-160000C" id="QQ2-1-253">If-else USE blocks</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-161000C" id="QQ2-1-255">CVS versions</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-162000C" id="QQ2-1-256">use.defaults</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-163000C" id="QQ2-1-257">Retroactive Changes</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-164000C" id="QQ2-1-258">Bash version</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-165000C" id="QQ2-1-259">Old-style virtuals</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-166000C" id="QQ2-1-260">EAPI parsing</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-167000C" id="QQ2-1-261">Package names</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-168000C" id="QQ2-1-262">Asterisk in dependency specification</a></span>
<br /> <span class="subsectionToc" ><a
href="#x1-169000C" id="QQ2-1-263">Empty dependency groups</a></span>
<br /><span class="appendixToc" >D <a
href="#x1-170000D" id="QQ2-1-264">Feature Availability by EAPI</a></span>
<br /><span class="appendixToc" >E <a
href="#x1-171000E" id="QQ2-1-266">Differences Between EAPIs</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-172000E" id="QQ2-1-267">EAPI 0</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-173000E" id="QQ2-1-268">EAPI 1</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-174000E" id="QQ2-1-269">EAPI 2</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-175000E" id="QQ2-1-270">EAPI 3</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-176000E" id="QQ2-1-271">EAPI 4</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-177000E" id="QQ2-1-272">EAPI 5</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-178000E" id="QQ2-1-273">EAPI 6</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-179000E" id="QQ2-1-274">EAPI 7</a></span>
<br /> <span class="sectionToc" ><a
href="#x1-180000E" id="QQ2-1-275">EAPI 8</a></span>
<br /><span class="appendixToc" >F <a
href="#x1-181000F" id="QQ2-1-276">Desk Reference</a></span>
</div>
<h2 class="likechapterHead"><a
id="x1-2000"></a>List of Algorithms</h2>
<div class="tableofcontents">
3.1 <a
href="#x1-26001r1">Version comparison top-level logic</a>
<br />3.2 <a
href="#x1-26008r2">Version comparison logic for numeric components</a>
<br />3.3 <a
href="#x1-26025r3">Version comparison logic for each numeric component after the first</a>
<br />3.4 <a
href="#x1-26041r4">Version comparison logic for letter components</a>
<br />3.5 <a
href="#x1-26049r5">Version comparison logic for suffixes</a>
<br />3.6 <a
href="#x1-26069r6">Version comparison logic for each suffix</a>
<br />3.7 <a
href="#x1-26083r7">Version comparison logic for revision components</a>
<br />5.1 <a
href="#x1-54002r1"><span
class="ectt-1000">USE </span>masking logic</a>
<br />12.1 <a
href="#x1-127001r1"><span
class="ectt-1000">eapply </span>logic</a>
<br />12.2 <a
href="#x1-128002r2"><span
class="ectt-1000">econf --libdir </span>logic</a>
<br />12.3 <a
href="#x1-129001r3">Determining the library directory</a>
<br />12.4 <a
href="#x1-135003r4"><span
class="ectt-1000">einstalldocs </span>logic</a>
<br />12.5 <a
href="#x1-135025r5"><span
class="ectt-1000">get_libdir </span>logic</a>
</div>
<h2 class="likechapterHead"><a
id="x1-3000"></a>List of Listings</h2>
<div class="tableofcontents">
9.1 <a
href="#x1-89001r1"><span
class="ectt-1000">src_unpack</span></a>
<br />9.2 <a
href="#x1-90002r2"><span
class="ectt-1000">src_prepare</span>, format6</a>
<br />9.3 <a
href="#x1-90003r3"><span
class="ectt-1000">src_prepare</span>, format8</a>
<br />9.4 <a
href="#x1-91002r4"><span
class="ectt-1000">src_configure</span></a>
<br />9.5 <a
href="#x1-92002r5"><span
class="ectt-1000">src_compile</span>, format0</a>
<br />9.6 <a
href="#x1-92003r6"><span
class="ectt-1000">src_compile</span>, format1</a>
<br />9.7 <a
href="#x1-92004r7"><span
class="ectt-1000">src_compile</span>, format2</a>
<br />9.8 <a
href="#x1-94002r8"><span
class="ectt-1000">src_install</span>, format4</a>
<br />9.9 <a
href="#x1-94003r9"><span
class="ectt-1000">src_install</span>, format6</a>
<br />10.1 <a
href="#x1-107001r1"><span
class="ectt-1000">EXPORT_FUNCTIONS </span>example: <span
class="ectt-1000">foo.eclass</span></a>
<br />11.1 <a
href="#x1-114001r1">Environment state between functions</a>
<br />12.1 <a
href="#x1-128017r1"><span
class="ectt-1000">einstall </span>command</a>
<br />12.2 <a
href="#x1-129018r2">Create a relative path for <span
class="ectt-1000">dosym -r</span></a>
<br />C.1 <a
href="#x1-160001r1">If-else use blocks</a>
</div>
<h2 class="likechapterHead"><a
id="x1-4000"></a>List of Tables</h2>
<div class="tableofcontents"><span class="lotToc" >4.1 <a
href="#x1-32001r1">EAPIs supporting a directory for <span
class="ectt-1000">package.mask</span></a></span><br /><span class="lotToc" >4.2 <a
href="#x1-36001r2">Naming rules for files in <span
class="ectt-1000">updates</span>
directory for EAPIs</a></span><br /><span class="lotToc" >5.1 <a
href="#x1-48001r1">EAPIs supporting directories for profile files</a></span><br /><span class="lotToc" >5.2 <a
href="#x1-52001r2">EAPIs supporting
<span
class="ectt-1000">package.provided </span>in profiles</a></span><br /><span class="lotToc" >5.3 <a
href="#x1-54001r3">Profile directory support for masking/forcing use flags
in stable versions only</a></span><br /><span class="lotToc" >5.4 <a
href="#x1-56001r4">Profile-defined <span
class="ectt-1000">IUSE </span>injection for EAPIs</a></span><br /><span class="lotToc" >5.5 <a
href="#x1-56002r5">Profile-defined
unsetting of variables in EAPIs</a></span><br /><span class="lotToc" >6.1 <a
href="#x1-58001r1">Bash version and options</a></span><br /><span class="lotToc" >7.1 <a
href="#x1-62001r1">EAPIs supporting <span
class="ectt-1000">IUSE</span>
defaults</a></span><br /><span class="lotToc" >7.2 <a
href="#x1-62002r2">EAPIs supporting various ebuild-defined variables</a></span><br /><span class="lotToc" >7.3 <a
href="#x1-64001r3">EAPIs supporting
<span
class="ectt-1000">SRC_URI </span>arrows and selective URI restrictions</a></span><br /><span class="lotToc" >7.4 <a
href="#x1-69001r4">EAPIs with <span
class="ectt-1000">RDEPEND=DEPEND</span>
default</a></span><br /><span class="lotToc" >7.5 <a
href="#x1-70001r5">EAPIs supporting <span
class="ectt-1000">DEFINED_PHASES</span></a></span><br /><span class="lotToc" >8.1 <a
href="#x1-72001r1">Dependency classes required to
be satisfied for a particular phase function</a></span><br /><span class="lotToc" >8.2 <a
href="#x1-72002r2">Summary of other interfaces related
to dependency classes</a></span><br /><span class="lotToc" >8.3 <a
href="#x1-72003r3">Prefix values for <span
class="ectt-1000">DEPEND</span></a></span><br /><span class="lotToc" >8.4 <a
href="#x1-72004r4">EAPIs supporting additional
dependency types</a></span><br /><span class="lotToc" >8.5 <a
href="#x1-73001r5">EAPIs supporting <span
class="ectt-1000">REQUIRED_USE ?? </span>groups</a></span><br /><span class="lotToc" >8.6 <a
href="#x1-77001r6">Matching of
empty dependency groups in EAPIs</a></span><br /><span class="lotToc" >8.7 <a
href="#x1-79001r7">Support for <span
class="ectt-1000">SLOT </span>dependencies and sub-slots
in EAPIs</a></span><br /><span class="lotToc" >8.8 <a
href="#x1-79002r8">EAPIs supporting <span
class="ectt-1000">USE </span>dependencies</a></span><br /><span class="lotToc" >8.9 <a
href="#x1-81001r9">Exclamation mark strengths for
EAPIs</a></span><br /><span class="lotToc" >9.1 <a
href="#x1-86001r1">Initial working directory in <span
class="ectt-1000">pkg_* </span>phase functions for EAPIs</a></span><br /><span class="lotToc" >9.2 <a
href="#x1-86002r2">EAPIs with
<span
class="ectt-1000">S </span>to <span
class="ectt-1000">WORKDIR </span>fallbacks</a></span><br /><span class="lotToc" >9.3 <a
href="#x1-87001r3">EAPIs supporting <span
class="ectt-1000">pkg_pretend</span></a></span><br /><span class="lotToc" >9.4 <a
href="#x1-90001r4"><span
class="ectt-1000">src_prepare </span>support
and behaviour for EAPIs</a></span><br /><span class="lotToc" >9.5 <a
href="#x1-91001r5">EAPIs supporting <span
class="ectt-1000">src_configure</span></a></span><br /><span class="lotToc" >9.6 <a
href="#x1-92001r6"><span
class="ectt-1000">src_compile</span>
behaviour for EAPIs</a></span><br /><span class="lotToc" >9.7 <a
href="#x1-93001r7"><span
class="ectt-1000">src_test </span>behaviour for EAPIs</a></span><br /><span class="lotToc" >9.8 <a
href="#x1-94001r8"><span
class="ectt-1000">src_install </span>behaviour
for EAPIs</a></span><br /><span class="lotToc" >9.9 <a
href="#x1-100001r9">EAPIs supporting <span
class="ectt-1000">pkg_info </span>on non-installed packages</a></span><br /><span class="lotToc" >9.10 <a
href="#x1-102001r10">EAPIs
supporting <span
class="ectt-1000">default_ </span>phase functions</a></span><br /><span class="lotToc" >10.1 <a
href="#x1-106001r1">EAPIs accumulating <span
class="ectt-1000">PROPERTIES </span>and
<span
class="ectt-1000">RESTRICT </span>across eclasses</a></span><br /><span class="lotToc" >11.1 <a
href="#x1-109001r1">Defined variables</a></span><br /><span class="lotToc" >11.2 <a
href="#x1-109007r2">EAPIs supporting various added
env variables</a></span><br /><span class="lotToc" >11.3 <a
href="#x1-109008r3">EAPIs supporting various removed env variables</a></span><br /><span class="lotToc" >11.4 <a
href="#x1-109009r4">EAPIs
supporting offset-prefix env variables</a></span><br /><span class="lotToc" >11.5 <a
href="#x1-109010r5">Locale settings for EAPIs</a></span><br /><span class="lotToc" >11.6 <a
href="#x1-112001r6">EAPIs
supporting offset-prefix</a></span><br /><span class="lotToc" >11.7 <a
href="#x1-113001r7">Variables that always or never end with a trailing
slash</a></span><br /><span class="lotToc" >12.1 <a
href="#x1-118001r1">System commands for EAPIs</a></span><br /><span class="lotToc" >12.2 <a
href="#x1-121001r2">EAPI command failure behaviour</a></span><br /><span class="lotToc" >12.3 <a
href="#x1-122001r3">Banned
commands</a></span><br /><span class="lotToc" >12.4 <a
href="#x1-124001r4">Package manager query command options supported by EAPIs</a></span><br /><span class="lotToc" >12.5 <a
href="#x1-125001r5">Output
commands for EAPIs</a></span><br /><span class="lotToc" >12.6 <a
href="#x1-126001r6">Properties of <span
class="ectt-1000">die </span>and <span
class="ectt-1000">assert </span>commands in EAPIs</a></span><br /><span class="lotToc" >12.7 <a
href="#x1-127033r7">Patch
commands for EAPIs</a></span><br /><span class="lotToc" >12.8 <a
href="#x1-128001r8">Extra <span
class="ectt-1000">econf </span>arguments for EAPIs</a></span><br /><span class="lotToc" >12.9 <a
href="#x1-129019r9">EAPIs supporting <span
class="ectt-1000">dodoc</span>
<span
class="ectt-1000">-r</span></a></span><br /><span class="lotToc" >12.10 <a
href="#x1-129020r10">EAPIs supporting <span
class="ectt-1000">doheader </span>and <span
class="ectt-1000">newheader</span></a></span><br /><span class="lotToc" >12.11 <a
href="#x1-129021r11">EAPIs supporting symlinks
for <span
class="ectt-1000">doins</span></a></span><br /><span class="lotToc" >12.12 <a
href="#x1-129022r12"><span
class="ectt-1000">doman </span>language support options for EAPIs</a></span><br /><span class="lotToc" >12.13 <a
href="#x1-129023r13">EAPIs supporting
stdin for <span
class="ectt-1000">new* </span>commands</a></span><br /><span class="lotToc" >12.14 <a
href="#x1-129024r14"><span
class="ectt-1000">domo </span>destination path in EAPIs</a></span><br /><span class="lotToc" >12.15 <a
href="#x1-129025r15">EAPIs supporting
<span
class="ectt-1000">dosym -r</span></a></span><br /><span class="lotToc" >12.16 <a
href="#x1-130001r16">Commands respecting <span
class="ectt-1000">insopts </span>for EAPIs</a></span><br /><span class="lotToc" >12.17 <a
href="#x1-130002r17">Commands respecting
<span
class="ectt-1000">exeopts </span>for EAPIs</a></span><br /><span class="lotToc" >12.18 <a
href="#x1-131001r18">Commands controlling manipulation of files in the staging
area in EAPIs</a></span><br /><span class="lotToc" >12.19 <a
href="#x1-132001r19">EAPI behaviour for use queries not in <span
class="ectt-1000">IUSE_EFFECTIVE</span></a></span><br /><span class="lotToc" >12.20 <a
href="#x1-132002r20"><span
class="ectt-1000">usev</span>,
<span
class="ectt-1000">use_with </span>and <span
class="ectt-1000">use_enable </span>arguments for EAPIs</a></span><br /><span class="lotToc" >12.21 <a
href="#x1-132003r21">EAPIs supporting <span
class="ectt-1000">usex </span>and
<span
class="ectt-1000">in_iuse</span></a></span><br /><span class="lotToc" >12.22 <a
href="#x1-134001r22">EAPIs supporting version manipulation commands</a></span><br /><span class="lotToc" >12.23 <a
href="#x1-135001r23"><span
class="ectt-1000">unpack</span>
behaviour for EAPIs</a></span><br /><span class="lotToc" >12.24 <a
href="#x1-135002r24"><span
class="ectt-1000">unpack </span>extensions for EAPIs</a></span><br /><span class="lotToc" >12.25 <a
href="#x1-135034r25">Misc commands for
EAPIs</a></span><br /><span class="lotToc" >13.1 <a
href="#x1-145001r1">Preservation of file modification times (mtimes)</a></span><br /><span class="lotToc" >D.1 <a
href="#x1-170001r1">Features in EAPIs</a></span><br />
</div>
<h2 class="chapterHead"><span class="titlemark">Chapter 1</span><br /><a
id="x1-50001"></a>Introduction</h2>
<h3 class="sectionHead"><span class="titlemark">1.1 </span> <a
id="x1-60001.1"></a>Aims and Motivation</h3>
<!--l. 5--><p class="noindent" >This document aims to fully describe the format of an ebuild repository and the ebuilds therein,
as well as certain aspects of package manager behaviour required to support such a
repository.
</p><!--l. 8--><p class="noindent" >This document is <span
class="ecti-1000">not </span>designed to be an introduction to ebuild development. Prior knowledge of
ebuild creation and an understanding of how the package management system works is assumed;
certain less familiar terms are explained in the Glossary in chapter <a
href="#x1-15400015">15<!--tex4ht:ref: ch:glossary --></a>.
</p><!--l. 12--><p class="noindent" >This document does not specify any user or package manager configuration information.
</p><!--l. 14--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">1.2 </span> <a
id="x1-70001.2"></a>Rationale</h3>
<!--l. 16--><p class="noindent" >At present the only definition of what an ebuild can assume about its environment,
and the only definition of what is valid in an ebuild, is the source code of the latest
Portage release and a general consensus about which features are too new to assume
availability. This has several drawbacks: not only is it impossible to change any aspect of
Portage behaviour without verifying that nothing in the tree relies upon it, but if a new
package manager should appear it becomes impossible to fully support such an ill-defined
standard.
</p><!--l. 23--><p class="noindent" >This document aims to address both of these concerns by defining almost all aspects of what an
ebuild repository looks like, and how an ebuild is allowed to behave. Thus, both Portage and other
package managers can change aspects of their behaviour not defined here without worry of
incompatibilities with any particular repository.
</p><!--l. 28--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">1.3 </span> <a
id="x1-80001.3"></a>Reporting Issues</h3>
<!--l. 30--><p class="noindent" >Issues (inaccuracies, wording problems, omissions etc.) in this document should be reported via
Gentoo Bugzilla using product <span
class="ecti-1000">Gentoo Hosted Projects</span>, component <span
class="ecti-1000">PMS/EAPI </span>and the default
assignee. There should be one bug per issue, and one issue per bug.
</p><!--l. 34--><p class="noindent" >Patches (in <span
class="ectt-1000">git format-patch </span>form if possible) may be submitted either via Bugzilla or to the
<a
href="mailto:gentoo-pms@lists.gentoo.org" ><span
class="ectt-1000">gentoo-pms@lists.gentoo.org</span></a> mailing list. Patches will be reviewed by the PMS team, who will
do one of the following:
</p><!--l. 39--><p class="noindent" >
</p><ul>
<li class="compactitem">Accept and apply the patch.
</li>
<li class="compactitem">Explain why the patch cannot be applied as-is. The patch may then be updated and
resubmitted if appropriate.
</li>
<li class="compactitem">Reject the patch outright.
</li>
<li class="compactitem">Take special action merited by the individual circumstances.</li></ul>
<!--l. 46--><p class="noindent" >When reporting issues, remember that this document is not the appropriate place for pushing
through changes to the tree or the package manager, except where those changes are
bugs.
</p><!--l. 49--><p class="noindent" >If any issue cannot be resolved by the PMS team, it may be escalated to the Gentoo
Council.
</p><!--l. 51--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">1.4 </span> <a
id="x1-90001.4"></a>Conventions</h3>
<!--l. 53--><p class="noindent" >Text in <span
class="ectt-1000">teletype </span>is used for filenames or variable names. <span
class="ecti-1000">Italic </span>text is used for terms with a
particular technical meaning in places where there may otherwise be ambiguity.
</p><!--l. 56--><p class="noindent" >The term <span
class="ecti-1000">package manager </span>is used throughout this document in a broad sense. Although some
parts of this document are only relevant to fully featured package managers, many items are
equally applicable to tools or other applications that interact with ebuilds or ebuild
repositories.
</p><!--l. 60--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">1.5 </span> <a
id="x1-100001.5"></a>Acknowledgements</h3>
<!--l. 62--><p class="noindent" >Thanks to Mike Kelly (package manager provided utilities, section <a
href="#x1-12000012.3">12.3<!--tex4ht:ref: sec:pkg-mgr-commands --></a>), Danny van Dyk (ebuild
functions, chapter <a
href="#x1-840009">9<!--tex4ht:ref: ch:ebuild-functions --></a>), David Leverton (various sections), Petteri Räty (environment state,
section <a
href="#x1-11400011.2">11.2<!--tex4ht:ref: sec:ebuild-env-state --></a>), Michał Górny (various sections), Andreas K. Hüttel (stable use masking,
section <a
href="#x1-540005.2.11">5.2.11<!--tex4ht:ref: sec:use-masking --></a>), Zac Medico (sub-slots, section <a
href="#x1-610007.2">7.2<!--tex4ht:ref: sec:mandatory-vars --></a>) and James Le Cuirot (build dependencies,
section <a
href="#x1-10900011.1">11.1<!--tex4ht:ref: sec:ebuild-env-vars --></a>) for contributions. Thanks also to Mike Frysinger and Brian Harring for proof-reading
and suggestions for fixes and/or clarification.
</p>
<h2 class="chapterHead"><span class="titlemark">Chapter 2</span><br /><a
id="x1-110002"></a>EAPIs</h2>
<h3 class="sectionHead"><span class="titlemark">2.1 </span> <a
id="x1-120002.1"></a>Definition</h3>
<!--l. 5--><p class="noindent" >An EAPI can be thought of as a ‘version’ of this specification to which a package conforms. An
EAPI value is a string as per section <a
href="#x1-240003.1.8">3.1.8<!--tex4ht:ref: sec:eapi-names --></a>, and is part of an ebuild’s metadata.
</p><!--l. 8--><p class="noindent" >If a package manager encounters a package version with an unrecognised EAPI, it must not
attempt to perform any operations upon it. It could, for example, ignore the package version
entirely (although this can lead to user confusion), or it could mark the package version as masked.
A package manager must not use any metadata generated from a package with an unrecognised
EAPI.
</p><!--l. 13--><p class="noindent" >The package manager must not attempt to perform any kind of comparison test other than
equality upon EAPIs.
</p><!--l. 16--><p class="noindent" >EAPIs are also used for profile directories, as described in section <a
href="#x1-450005.2.2">5.2.2<!--tex4ht:ref: sec:profile-eapi --></a>.
</p><!--l. 18--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">2.2 </span> <a
id="x1-130002.2"></a>Defined EAPIs</h3>
<!--l. 21--><p class="noindent" >This specification defines EAPIs ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, and ‘8’. EAPI ‘0’ is the
‘original’ base EAPI. Each of the later EAPIs contains a number of extensions to its
predecessor.
</p><!--l. 25--><p class="noindent" >Except where explicitly noted, everything in this specification applies to all of the above
EAPIs.
</p><!--l. 28--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">2.3 </span> <a
id="x1-140002.3"></a>Reserved EAPIs</h3>
<!--l. 31--><p class="noindent" >
</p><ul>
<li class="compactitem">EAPIs whose value consists purely of an integer are reserved for future versions of this
specification.
</li>
<li class="compactitem">EAPIs whose value starts with the string <span
class="ectt-1000">paludis- </span>are reserved for experimental use
by the Paludis package manager.</li></ul>
<h2 class="chapterHead"><span class="titlemark">Chapter 3</span><br /><a
id="x1-150003"></a>Names and Versions</h2>
<h3 class="sectionHead"><span class="titlemark">3.1 </span> <a
id="x1-160003.1"></a>Restrictions upon Names</h3>
<!--l. 5--><p class="noindent" >No name may be empty. Package managers must not impose fixed upper boundaries upon the
length of any name. A package manager should indicate or reject any name that is invalid
according to these rules.
</p><!--l. 8--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.1 </span> <a
id="x1-170003.1.1"></a>Category names</h4>
<!--l. 9--><p class="noindent" >A category name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9+_.-</span>]. It must not begin with a
hyphen, a dot or a plus sign.
</p><!--l. 12--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.2 </span> <a
id="x1-180003.1.2"></a>Package names</h4>
<!--l. 14--><p class="noindent" >A package name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9+_-</span>]. It must not begin with a
hyphen or a plus sign, and must not end in a hyphen followed by anything matching the version
syntax described in section <a
href="#x1-250003.2">3.2<!--tex4ht:ref: sec:version-spec --></a>.
</p><!--l. 19--><p class="noindent" >
</p><dl class="trivlist"><dt class="trivlist">
</dt><dd
class="trivlist">
<!--l. 19--><p class="noindent" ><span
class="ecbx-1000">Note: </span>A package name does not include the category. The term <span
class="ecti-1000">qualified package name </span>is
used where a <span
class="ectt-1000">category/package </span>pair is meant.</p></dd></dl>
<!--l. 21--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.3 </span> <a
id="x1-190003.1.3"></a>Slot names</h4>
<!--l. 23--><p class="noindent" >A slot name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9+_.-</span>]. It must not begin with a hyphen,
a dot or a plus sign.
</p><!--l. 26--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.4 </span> <a
id="x1-200003.1.4"></a>USE flag names</h4>
<!--l. 27--><p class="noindent" >A USE flag name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9+_@-</span>]. It must begin with an
alphanumeric character. Underscores should be considered reserved for <span
class="ectt-1000">USE_EXPAND</span>, as described in
section <a
href="#x1-11000011.1.1">11.1.1<!--tex4ht:ref: sec:use-iuse-handling --></a>.
</p><!--l. 31--><p class="noindent" >
</p><dl class="trivlist"><dt class="trivlist">
</dt><dd
class="trivlist">
<!--l. 31--><p class="noindent" ><span
class="ecbx-1000">Note: </span>Usage of the at-sign is deprecated. It was previously required for <span
class="ectt-1000">LINGUAS</span>.</p></dd></dl>
<!--l. 33--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.5 </span> <a
id="x1-210003.1.5"></a>Repository names</h4>
<!--l. 35--><p class="noindent" >A repository name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9_-</span>]. It must not begin with a
hyphen. In addition, every repository name must also be a valid package name.
</p><!--l. 38--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.6 </span> <a
id="x1-220003.1.6"></a>License names</h4>
<!--l. 40--><p class="noindent" >A license name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9+_.-</span>]. It must not begin with a
hyphen, a dot or a plus sign.
</p><!--l. 43--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.7 </span> <a
id="x1-230003.1.7"></a>Keyword names</h4>
<!--l. 45--><p class="noindent" >A keyword name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9_-</span>]. It must not begin with a
hyphen. In contexts where it makes sense to do so, a keyword name may be prefixed by a tilde or a
hyphen. In <span
class="ectt-1000">KEYWORDS</span>, <span
class="ectt-1000">-* </span>is also acceptable as a keyword.
</p><!--l. 49--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">3.1.8 </span> <a
id="x1-240003.1.8"></a>EAPI names</h4>
<!--l. 51--><p class="noindent" >An EAPI name may contain any of the characters [<span
class="ectt-1000">A-Za-z0-9+_.-</span>]. It must not begin with a
hyphen, a dot or a plus sign.
</p><!--l. 54--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">3.2 </span> <a
id="x1-250003.2"></a>Version Specifications</h3>
<!--l. 56--><p class="noindent" >The package manager must neither impose fixed limits upon the number of version components,
nor upon the length of any component. Package managers should indicate or reject any version
that is invalid according to the rules below.
</p><!--l. 60--><p class="noindent" >A version starts with the number part, which is in the form <span
class="ectt-1000">[0-9]+(\.[0-9]+)* </span>(an unsigned
integer, followed by zero or more dot-prefixed unsigned integers).
</p><!--l. 63--><p class="noindent" >This may optionally be followed by one of <span
class="ectt-1000">[a-z] </span>(a lowercase letter).
</p><!--l. 65--><p class="noindent" >This may be followed by zero or more of the suffixes <span
class="ectt-1000">_alpha</span>, <span
class="ectt-1000">_beta</span>, <span
class="ectt-1000">_pre</span>, <span
class="ectt-1000">_rc </span>or <span
class="ectt-1000">_p</span>, each of which
may optionally be followed by an unsigned integer. Suffix and integer count as separate version
components.
</p><!--l. 69--><p class="noindent" >This may optionally be followed by the suffix <span
class="ectt-1000">-r </span>followed immediately by an unsigned integer (the
“revision number”). If this suffix is not present, it is assumed to be <span
class="ectt-1000">-r0</span>.
</p><!--l. 72--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">3.3 </span> <a
id="x1-260003.3"></a>Version Comparison</h3>
<!--l. 74--><p class="noindent" >Version specifications are compared component by component, moving from left to right, as
detailed in algorithm <a
href="#x1-26001r1">3.1<!--tex4ht:ref: alg:version-comparison --></a> and sub-algorithms. If a sub-algorithm returns a decision, then that is
the result of the whole comparison; if it terminates without returning a decision, the process
continues from the point from which it was invoked.
</p>
<div class="algorithm">
<!--l. 80--><p class="noindent" ><a
id="x1-26001r1"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Algorithm 3.1: </span><span
class="content">Version comparison top-level logic</span></div><!--tex4ht:label?: x1-26001r1 -->
<div class="algorithmic">
<a
id="x1-26002r1"></a>
<span class="ALCitem">1:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">A </span>and <span
class="cmmi-10">B </span>be the versions to be compared <a
id="x1-26003r2"></a>
<br /><span class="ALCitem">2:</span><span class="ALIndent" style="width:4.99878pt;"> </span> compare numeric components using algorithm <a
href="#x1-26008r2">3.2<!--tex4ht:ref: alg:version-comparison-numeric --></a> <a
id="x1-26004r3"></a>
<br /><span class="ALCitem">3:</span><span class="ALIndent" style="width:4.99878pt;"> </span> compare letter components using algorithm <a
href="#x1-26041r4">3.4<!--tex4ht:ref: alg:version-comparison-letter --></a> <a
id="x1-26005r4"></a>
<br /><span class="ALCitem">4:</span><span class="ALIndent" style="width:4.99878pt;"> </span> compare suffixes using algorithm <a
href="#x1-26049r5">3.5<!--tex4ht:ref: alg:version-comparison-suffix --></a> <a
id="x1-26006r5"></a>
<br /><span class="ALCitem">5:</span><span class="ALIndent" style="width:4.99878pt;"> </span> compare revision components using algorithm <a
href="#x1-26083r7">3.7<!--tex4ht:ref: alg:version-comparison-revision --></a> <a
id="x1-26007r6"></a>
<br /><span class="ALCitem">6:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A </span><span
class="cmr-10">= </span><span
class="cmmi-10">B</span>
</div>
</div><hr class="endfloat" />
</div>
<div class="algorithm">
<!--l. 92--><p class="noindent" ><a
id="x1-26008r2"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Algorithm 3.2: </span><span
class="content">Version comparison logic for numeric components</span></div><!--tex4ht:label?: x1-26008r2 -->
<div class="algorithmic">
<a
id="x1-26009r7"></a>
<span class="ALCitem">1:</span><span class="ALIndent" style="width:4.99878pt;"> </span> define the notations <span
class="cmmi-10">An</span><sub><span
class="cmmi-7">k</span></sub> and <span
class="cmmi-10">Bn</span><sub><span
class="cmmi-7">k</span></sub> to mean the <span
class="cmmi-10">k</span><sup class="textsuperscript"><span
class="ecrm-0900">th</span></sup> numeric component of <span
class="cmmi-10">A </span>and <span
class="cmmi-10">B</span>
respectively, using <span
class="cmr-10">0</span>-based indexing <a
id="x1-26010r8"></a>
<br /><span class="ALCitem">2:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">An</span><sub><span
class="cmr-7">0</span></sub> <span
class="cmmi-10">> Bn</span><sub><span
class="cmr-7">0</span></sub> using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26011r9"></a>
<br /><span class="ALCitem">3:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26012r10"></a>
<br /><span class="ALCitem">4:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">An</span><sub><span
class="cmr-7">0</span></sub> <span
class="cmmi-10">< Bn</span><sub><span
class="cmr-7">0</span></sub> using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26013r11"></a>
<br /><span class="ALCitem">5:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26014r12"></a>
<br /><span class="ALCitem">6:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span><a
id="x1-26015r13"></a>
<br /><span class="ALCitem">7:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Ann </span>be the number of numeric components of <span
class="cmmi-10">A</span> <a
id="x1-26016r14"></a>
<br /><span class="ALCitem">8:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Bnn </span>be the number of numeric components of <span
class="cmmi-10">B</span> <a
id="x1-26017r15"></a>
<br /><span class="ALCitem">9:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">for all</span> <span
class="cmmi-10">i </span>such that <span
class="cmmi-10">i </span><span
class="cmsy-10">≥ </span><span
class="cmr-10">1 </span>and <span
class="cmmi-10">i < Ann </span>and <span
class="cmmi-10">i < Bnn</span>, in ascending order <span
class="ecbx-1000">do</span><span class="for-body">
<a
id="x1-26018r16"></a>
<br /><span class="ALCitem">10:</span><span class="ALIndent" style="width:14.99634pt;"> </span> compare <span
class="cmmi-10">An</span><sub><span
class="cmmi-7">i</span></sub> and <span
class="cmmi-10">Bn</span><sub><span
class="cmmi-7">i</span></sub> using algorithm <a
href="#x1-26025r3">3.3<!--tex4ht:ref: alg:version-comparison-numeric-nonfirst --></a>
</span><a
id="x1-26019r17"></a>
<br /><span class="ALCitem">11:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">for</span><a
id="x1-26020r18"></a>
<br /><span class="ALCitem">12:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Ann > Bnn</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26021r19"></a>
<br /><span class="ALCitem">13:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26022r20"></a>
<br /><span class="ALCitem">14:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Ann < Bnn</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26023r21"></a>
<br /><span class="ALCitem">15:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26024r22"></a>
<br /><span class="ALCitem">16:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</div>
</div><hr class="endfloat" />
</div>
<div class="algorithm">
<!--l. 115--><p class="noindent" ><a
id="x1-26025r3"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Algorithm 3.3: </span><span
class="content">Version comparison logic for each numeric component after the first</span></div><!--tex4ht:label?: x1-26025r3 -->
<div class="algorithmic">
<a
id="x1-26026r23"></a>
<span class="ALCitem">1:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">if</span> either <span
class="cmmi-10">An</span><sub><span
class="cmmi-7">i</span></sub> or <span
class="cmmi-10">Bn</span><sub><span
class="cmmi-7">i</span></sub> has a leading <span
class="ectt-1000">0</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26027r24"></a>
<br /><span class="ALCitem">2:</span><span class="ALIndent" style="width:14.99634pt;"> </span> let <span
class="cmmi-10">An</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> be <span
class="cmmi-10">An</span><sub><span
class="cmmi-7">i</span></sub> with any trailing <span
class="ectt-1000">0</span>s removed <a
id="x1-26028r25"></a>
<br /><span class="ALCitem">3:</span><span class="ALIndent" style="width:14.99634pt;"> </span> let <span
class="cmmi-10">Bn</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> be <span
class="cmmi-10">Bn</span><sub><span
class="cmmi-7">i</span></sub> with any trailing <span
class="ectt-1000">0</span>s removed <a
id="x1-26029r26"></a>
<br /><span class="ALCitem">4:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">An</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> <span
class="cmmi-10">> Bn</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> using ASCII stringwise comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26030r27"></a>
<br /><span class="ALCitem">5:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26031r28"></a>
<br /><span class="ALCitem">6:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">An</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> <span
class="cmmi-10">< Bn</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> using ASCII stringwise comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26032r29"></a>
<br /><span class="ALCitem">7:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26033r30"></a>
<br /><span class="ALCitem">8:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</span><a
id="x1-26034r31"></a>
<br /><span class="ALCitem">9:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span><span class="else-body">
<a
id="x1-26035r32"></a>
<br /><span class="ALCitem">10:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">An</span><sub><span
class="cmmi-7">i</span></sub> <span
class="cmmi-10">> Bn</span><sub><span
class="cmmi-7">i</span></sub> using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26036r33"></a>
<br /><span class="ALCitem">11:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26037r34"></a>
<br /><span class="ALCitem">12:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">An</span><sub><span
class="cmmi-7">i</span></sub> <span
class="cmmi-10">< Bn</span><sub><span
class="cmmi-7">i</span></sub> using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26038r35"></a>
<br /><span class="ALCitem">13:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26039r36"></a>
<br /><span class="ALCitem">14:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</span><a
id="x1-26040r37"></a>
<br /><span class="ALCitem">15:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</div>
</div><hr class="endfloat" />
</div>
<div class="algorithm">
<!--l. 137--><p class="noindent" ><a
id="x1-26041r4"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Algorithm 3.4: </span><span
class="content">Version comparison logic for letter components</span></div><!--tex4ht:label?: x1-26041r4 -->
<div class="algorithmic">
<a
id="x1-26042r38"></a>
<span class="ALCitem">1:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Al </span>be the letter component of <span
class="cmmi-10">A </span>if any, otherwise the empty string <a
id="x1-26043r39"></a>
<br /><span class="ALCitem">2:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Bl </span>be the letter component of <span
class="cmmi-10">B </span>if any, otherwise the empty string <a
id="x1-26044r40"></a>
<br /><span class="ALCitem">3:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Al > Bl </span>using ASCII stringwise comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26045r41"></a>
<br /><span class="ALCitem">4:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26046r42"></a>
<br /><span class="ALCitem">5:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Al < Bl </span>using ASCII stringwise comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26047r43"></a>
<br /><span class="ALCitem">6:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26048r44"></a>
<br /><span class="ALCitem">7:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</div>
</div><hr class="endfloat" />
</div>
<div class="algorithm">
<!--l. 150--><p class="noindent" ><a
id="x1-26049r5"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Algorithm 3.5: </span><span
class="content">Version comparison logic for suffixes</span></div><!--tex4ht:label?: x1-26049r5 -->
<div class="algorithmic">
<a
id="x1-26050r45"></a>
<span class="ALCitem">1:</span><span class="ALIndent" style="width:4.99878pt;"> </span> define the notations <span
class="cmmi-10">As</span><sub><span
class="cmmi-7">k</span></sub> and <span
class="cmmi-10">Bs</span><sub><span
class="cmmi-7">k</span></sub> to mean the <span
class="cmmi-10">k</span><sup class="textsuperscript"><span
class="ecrm-0900">th</span></sup> suffix of <span
class="cmmi-10">A </span>and <span
class="cmmi-10">B </span>respectively, using
<span
class="cmr-10">0</span>-based indexing <a
id="x1-26051r46"></a>
<br /><span class="ALCitem">2:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Asn </span>be the number of suffixes of <span
class="cmmi-10">A</span> <a
id="x1-26052r47"></a>
<br /><span class="ALCitem">3:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Bsn </span>be the number of suffixes of <span
class="cmmi-10">B</span> <a
id="x1-26053r48"></a>
<br /><span class="ALCitem">4:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">for all</span> <span
class="cmmi-10">i </span>such that <span
class="cmmi-10">i </span><span
class="cmsy-10">≥ </span><span
class="cmr-10">0 </span>and <span
class="cmmi-10">i < Asn </span>and <span
class="cmmi-10">i < Bsn</span>, in ascending order <span
class="ecbx-1000">do</span><span class="for-body">
<a
id="x1-26054r49"></a>
<br /><span class="ALCitem">5:</span><span class="ALIndent" style="width:14.99634pt;"> </span> compare <span
class="cmmi-10">As</span><sub><span
class="cmmi-7">i</span></sub> and <span
class="cmmi-10">Bs</span><sub><span
class="cmmi-7">i</span></sub> using algorithm <a
href="#x1-26069r6">3.6<!--tex4ht:ref: alg:version-comparison-suffix-each --></a>
</span><a
id="x1-26055r50"></a>
<br /><span class="ALCitem">6:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">for</span><a
id="x1-26056r51"></a>
<br /><span class="ALCitem">7:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Asn > Bsn</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26057r52"></a>
<br /><span class="ALCitem">8:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">As</span><sub><span
class="cmmi-7">Bsn</span></sub> is of type <span
class="ectt-1000">_p</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26058r53"></a>
<br /><span class="ALCitem">9:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26059r54"></a>
<br /><span class="ALCitem">10:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">else</span><span class="else-body">
<a
id="x1-26060r55"></a>
<br /><span class="ALCitem">11:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26061r56"></a>
<br /><span class="ALCitem">12:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</span><a
id="x1-26062r57"></a>
<br /><span class="ALCitem">13:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Asn < Bsn</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26063r58"></a>
<br /><span class="ALCitem">14:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Bs</span><sub><span
class="cmmi-7">Asn</span></sub> is of type <span
class="ectt-1000">_p</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26064r59"></a>
<br /><span class="ALCitem">15:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26065r60"></a>
<br /><span class="ALCitem">16:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">else</span><span class="else-body">
<a
id="x1-26066r61"></a>
<br /><span class="ALCitem">17:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26067r62"></a>
<br /><span class="ALCitem">18:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</span><a
id="x1-26068r63"></a>
<br /><span class="ALCitem">19:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</div>
</div><hr class="endfloat" />
</div>
<div class="algorithm">
<!--l. 176--><p class="noindent" ><a
id="x1-26069r6"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Algorithm 3.6: </span><span
class="content">Version comparison logic for each suffix</span></div><!--tex4ht:label?: x1-26069r6 -->
<div class="algorithmic">
<a
id="x1-26070r64"></a>
<span class="ALCitem">1:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">As</span><sub><span
class="cmmi-7">i</span></sub> and <span
class="cmmi-10">Bs</span><sub><span
class="cmmi-7">i</span></sub> are of the same type (<span
class="ectt-1000">_alpha </span>vs <span
class="ectt-1000">_beta </span>etc) <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26071r65"></a>
<br /><span class="ALCitem">2:</span><span class="ALIndent" style="width:14.99634pt;"> </span> let <span
class="cmmi-10">As</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> be the integer part of <span
class="cmmi-10">As</span><sub><span
class="cmmi-7">i</span></sub> if any, otherwise <span
class="ectt-1000">0</span> <a
id="x1-26072r66"></a>
<br /><span class="ALCitem">3:</span><span class="ALIndent" style="width:14.99634pt;"> </span> let <span
class="cmmi-10">Bs</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> be the integer part of <span
class="cmmi-10">Bs</span><sub><span
class="cmmi-7">i</span></sub> if any, otherwise <span
class="ectt-1000">0</span> <a
id="x1-26073r67"></a>
<br /><span class="ALCitem">4:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">As</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> <span
class="cmmi-10">> Bs</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub>, using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26074r68"></a>
<br /><span class="ALCitem">5:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26075r69"></a>
<br /><span class="ALCitem">6:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">As</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub> <span
class="cmmi-10">< Bs</span><span
class="cmsy-10">′</span><sub><span
class="cmmi-7">i</span></sub>, using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26076r70"></a>
<br /><span class="ALCitem">7:</span><span class="ALIndent" style="width:24.9939pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26077r71"></a>
<br /><span class="ALCitem">8:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</span><a
id="x1-26078r72"></a>
<br /><span class="ALCitem">9:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> the type of <span
class="cmmi-10">As</span><sub><span
class="cmmi-7">i</span></sub> is greater than the type of <span
class="cmmi-10">Bs</span><sub><span
class="cmmi-7">i</span></sub> using the ordering
<span
class="ectt-1000">_alpha</span> <span
class="cmmi-10"><</span> <span
class="ectt-1000">_beta</span> <span
class="cmmi-10"><</span> <span
class="ectt-1000">_pre</span> <span
class="cmmi-10"><</span> <span
class="ectt-1000">_rc</span> <span
class="cmmi-10"><</span> <span
class="ectt-1000">_p</span> <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26079r73"></a>
<br /><span class="ALCitem">10:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26080r74"></a>
<br /><span class="ALCitem">11:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span><span class="else-body">
<a
id="x1-26081r75"></a>
<br /><span class="ALCitem">12:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26082r76"></a>
<br /><span class="ALCitem">13:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</div>
</div><hr class="endfloat" />
</div>
<div class="algorithm">
<!--l. 196--><p class="noindent" ><a
id="x1-26083r7"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Algorithm 3.7: </span><span
class="content">Version comparison logic for revision components</span></div><!--tex4ht:label?: x1-26083r7 -->
<div class="algorithmic">
<a
id="x1-26084r77"></a>
<span class="ALCitem">1:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Ar </span>be the integer part of the revision component of <span
class="cmmi-10">A </span>if any, otherwise <span
class="ectt-1000">0</span> <a
id="x1-26085r78"></a>
<br /><span class="ALCitem">2:</span><span class="ALIndent" style="width:4.99878pt;"> </span> let <span
class="cmmi-10">Br </span>be the integer part of the revision component of <span
class="cmmi-10">B </span>if any, otherwise <span
class="ectt-1000">0</span> <a
id="x1-26086r79"></a>
<br /><span class="ALCitem">3:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Ar > Br </span>using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26087r80"></a>
<br /><span class="ALCitem">4:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A > B</span>
</span><a
id="x1-26088r81"></a>
<br /><span class="ALCitem">5:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">else</span> <span
class="ecbx-1000">if</span> <span
class="cmmi-10">Ar < Br </span>using integer comparison <span
class="ecbx-1000">then</span><span class="if-body">
<a
id="x1-26089r82"></a>
<br /><span class="ALCitem">6:</span><span class="ALIndent" style="width:14.99634pt;"> </span> <span
class="ecbx-1000">return </span> <span
class="cmmi-10">A < B</span>
</span><a
id="x1-26090r83"></a>
<br /><span class="ALCitem">7:</span><span class="ALIndent" style="width:4.99878pt;"> </span> <span
class="ecbx-1000">end</span> <span
class="ecbx-1000">if</span>
</div>
</div><hr class="endfloat" />
</div>
<h3 class="sectionHead"><span class="titlemark">3.4 </span> <a
id="x1-270003.4"></a>Uniqueness of Versions</h3>
<!--l. 211--><p class="noindent" >No two packages in a given repository may have the same qualified package name and equal
versions. For example, a repository may not contain more than one of <span
class="ectt-1000">foo-bar/baz-1.0.2</span>,
<span
class="ectt-1000">foo-bar/baz-1.0.2-r0 </span>and <span
class="ectt-1000">foo-bar/baz-1.000.2</span>.
</p>
<h2 class="chapterHead"><span class="titlemark">Chapter 4</span><br /><a
id="x1-280004"></a>Tree Layout</h2>
<!--l. 3--><p class="noindent" >This chapter defines the layout on-disk of an ebuild repository. In all cases below where a file or
directory is specified, a symlink to a file or directory is also valid. In this case, the package manager
must follow the operating system’s semantics for symbolic links and must not behave differently
from normal.
</p>
<h3 class="sectionHead"><span class="titlemark">4.1 </span> <a
id="x1-290004.1"></a>Top Level</h3>
<!--l. 10--><p class="noindent" >An ebuild repository shall occupy one directory on disk, with the following subdirectories:
</p><!--l. 13--><p class="noindent" >
</p><ul>
<li class="compactitem">One directory per category, whose name shall be the name of the category. The layout
of these directories shall be as described in section <a
href="#x1-300004.2">4.2<!--tex4ht:ref: sec:category-dirs --></a>.
</li>
<li class="compactitem">A <span
class="ectt-1000">profiles </span>directory, described in section <a
href="#x1-320004.4">4.4<!--tex4ht:ref: sec:profiles-dir --></a>.
</li>
<li class="compactitem">A <span
class="ectt-1000">licenses </span>directory (optional), described in section <a
href="#x1-370004.5">4.5<!--tex4ht:ref: sec:licenses-dir --></a>.
</li>
<li class="compactitem">An <span
class="ectt-1000">eclass </span>directory (optional), described in section <a
href="#x1-380004.6">4.6<!--tex4ht:ref: sec:eclass-dir --></a>.
</li>
<li class="compactitem">A <span
class="ectt-1000">metadata </span>directory (optional), described in section <a
href="#x1-390004.7">4.7<!--tex4ht:ref: sec:metadata-dir --></a>.
</li>
<li class="compactitem">Other optional support files and directories (skeleton ebuilds or ChangeLogs, for
example) may exist but are not covered by this specification. The package manager
must ignore any of these files or directories that it does not recognise.
</li></ul>
<h3 class="sectionHead"><span class="titlemark">4.2 </span> <a
id="x1-300004.2"></a>Category Directories</h3>
<!--l. 28--><p class="noindent" >Each category provided by the repository (see also: the <span
class="ectt-1000">profiles/categories </span>file, section <a
href="#x1-320004.4">4.4<!--tex4ht:ref: sec:profiles-dir --></a>)
shall be contained in one directory, whose name shall be that of the category. Each category
directory shall contain:
</p><ul>
<li class="compactitem">A <span
class="ectt-1000">metadata.xml </span>file, as described in appendix <a
href="#x1-156000A">A<!--tex4ht:ref: ch:metadata-xml --></a>. Optional.
</li>
<li class="compactitem">Zero or more package directories, one for each package in the category, as described
in section <a
href="#x1-310004.3">4.3<!--tex4ht:ref: sec:package-dirs --></a>. The name of the package directory shall be the corresponding package
name.</li></ul>
<!--l. 38--><p class="noindent" >Category directories may contain additional files, whose purpose is not covered by this
specification. Additional directories that are not for a package may <span
class="ecti-1000">not </span>be present, to avoid
conflicts with package name directories; an exception is made for filesystem components whose
name starts with a dot, which the package manager must ignore, and for any directory named
<span
class="ectt-1000">CVS</span>.
</p><!--l. 43--><p class="noindent" >It is not required that a directory exists for each category provided by the repository. A category
directory that does not exist shall be considered equivalent to an empty category (and by
extension, a package manager may treat an empty category as a category that does not
exist).
</p><!--l. 47--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">4.3 </span> <a
id="x1-310004.3"></a>Package Directories</h3>
<!--l. 50--><p class="noindent" >A package directory contains the following:
</p><!--l. 53--><p class="noindent" >
</p><ul>
<li class="compactitem">Zero or more ebuilds. These are as described in chapter <a
href="#x1-580006">6<!--tex4ht:ref: ch:ebuild-format --></a> and others.
</li>
<li class="compactitem">A <span
class="ectt-1000">metadata.xml </span>file, as described in appendix <a
href="#x1-156000A">A<!--tex4ht:ref: ch:metadata-xml --></a>. Optional only for legacy support.
</li>
<li class="compactitem">A <span
class="ectt-1000">ChangeLog</span>, in a format determined by the provider of the repository. Optional.
</li>
<li class="compactitem">A <span
class="ectt-1000">Manifest </span>file, whose format is described in <span class="cite">[<a
href="#XGlep74">1</a>]</span>. Can be omitted if the file would be
empty.
</li>
<li class="compactitem">A <span
class="ectt-1000">files </span>directory, containing any support files needed by the ebuilds. Optional.</li></ul>
<!--l. 62--><p class="noindent" >Any ebuild in a package directory must be named <span
class="ectt-1000">name-ver.ebuild</span>, where <span
class="ectt-1000">name </span>is the
(unqualified) package name, and <span
class="ectt-1000">ver </span>is the package’s version. Package managers must ignore any
ebuild file that does not match these rules.
</p><!--l. 66--><p class="noindent" >A package directory that contains no correctly named ebuilds shall be considered a package with
no versions. A package with no versions shall be considered equivalent to a package that does not
exist (and by extension, a package manager may treat a package that does not exist as a package
with no versions).
</p><!--l. 71--><p class="noindent" >A package directory may contain other files or directories, whose purpose is not covered by this
specification.
</p>
<h3 class="sectionHead"><span class="titlemark">4.4 </span> <a
id="x1-320004.4"></a>The Profiles Directory</h3>
<!--l. 77--><p class="noindent" >The profiles directory shall contain zero or more profile directories as described in chapter <a
href="#x1-410005">5<!--tex4ht:ref: ch:profiles --></a>, as
well as the following files and directories. In any line-based file, lines beginning with a <span
class="ectt-1000"># </span>character
are treated as comments, whilst blank lines are ignored. All contents of this directory, with the
exception of <span
class="ectt-1000">repo_name</span>, are optional.
</p><!--l. 82--><p class="noindent" >The profiles directory may contain an <span
class="ectt-1000">eapi </span>file. This file, if it exists, must contain a single line
with the name of an EAPI. This specifies the EAPI to use when handling the profiles
directory; a package manager must not attempt to use any repository whose profiles
directory requires an EAPI it does not support. If no <span
class="ectt-1000">eapi </span>file is present, EAPI 0 shall be
used.
</p><!--l. 87--><p class="noindent" >If the repository is not intended to be stand-alone, the contents of these files are to be taken from
or merged with the master repository as necessary.
</p><!--l. 90--><p class="noindent" >Other files not described by this specification may exist, but may not be relied upon. The package
manager must ignore any files in this directory that it does not recognise.
</p><dl class="description"><dt class="description">
<!--l. 94--><p class="noindent" >
<span
class="ecbx-1000">arch.list</span> </p></dt><dd
class="description">
<!--l. 94--><p class="noindent" >Contains a list, one entry per line, of permissible values for the <span
class="ectt-1000">ARCH </span>variable, and
hence permissible keywords for packages in this repository.
</p></dd><dt class="description">
<!--l. 96--><p class="noindent" >
<span
class="ecbx-1000">categories</span> </p></dt><dd
class="description">
<!--l. 96--><p class="noindent" >Contains a list, one entry per line, of categories provided by this repository.
</p></dd><dt class="description">
<!--l. 97--><p class="noindent" >
<span
class="ecbx-1000">eapi</span> </p></dt><dd
class="description">
<!--l. 97--><p class="noindent" >See above.
</p></dd><dt class="description">
<!--l. 98--><p class="noindent" >
<span
class="ecbx-1000">info_pkgs</span> </p></dt><dd
class="description">
<!--l. 98--><p class="noindent" >Contains a list, one entry per line, of qualified package names. Any package matching
one of these is to be listed when a package manager displays a ‘system information’
listing.
</p></dd><dt class="description">
<!--l. 101--><p class="noindent" >
<span
class="ecbx-1000">info_vars</span> </p></dt><dd
class="description">
<!--l. 101--><p class="noindent" >Contains a list, one entry per line, of profile, configuration, and environment variables
which are considered to be of interest. The value of each of these variables may be
shown when the package manager displays a ‘system information’ listing.
</p></dd><dt class="description">
<!--l. 104--><p class="noindent" >
<span
class="ecbx-1000">package.mask</span> </p></dt><dd
class="description">
<!--l. 104--><p class="noindent" >Contains a list, one entry per line, of package dependency specifications (using the
directory’s EAPI). Any package version matching one of these is considered to be
masked, and will not be installed regardless of profile unless it is unmasked by the user
configuration.
</p><!--l. 109--><p class="noindent" ><span class="fbox"><span
class="eccc1000-"><span
class="small-caps">package-mask-dir</span></span></span> For EAPIs listed in table <a
href="#x1-32001r1">4.1<!--tex4ht:ref: tab:package-mask-dir --></a> as supporting it, <span
class="ectt-1000">package.mask </span>can
be a directory instead of a regular file. Files contained in that directory, unless their
name begins with a dot, will be concatenated in order of their filename in the POSIX
locale and the result will be processed as if it were a single file. Any subdirectories will
be ignored.
</p></dd><dt class="description">
<!--l. 114--><p class="noindent" >
<span
class="ecbx-1000">profiles.desc</span> </p></dt><dd
class="description">
<!--l. 114--><p class="noindent" >Described below in section <a
href="#x1-330004.4.1">4.4.1<!--tex4ht:ref: sec:profiles.desc --></a>.
</p></dd><dt class="description">
<!--l. 115--><p class="noindent" >
<span
class="ecbx-1000">repo_name</span> </p></dt><dd
class="description">
<!--l. 115--><p class="noindent" >Contains, on a single line, the name of this repository. The repository name must
conform to section <a
href="#x1-210003.1.5">3.1.5<!--tex4ht:ref: sec:repository-names --></a>.
</p></dd><dt class="description">
<!--l. 117--><p class="noindent" >
<span
class="ecbx-1000">thirdpartymirrors</span> </p></dt><dd
class="description">
<!--l. 117--><p class="noindent" >Described below in section <a
href="#x1-340004.4.2">4.4.2<!--tex4ht:ref: sec:thirdpartymirrors --></a>.
</p></dd><dt class="description">
<!--l. 118--><p class="noindent" >
<span
class="ecbx-1000">use.desc</span> </p></dt><dd
class="description">
<!--l. 118--><p class="noindent" >Contains descriptions of valid global USE flags for this repository. The format is
described in section <a
href="#x1-350004.4.3">4.4.3<!--tex4ht:ref: sec:use.desc --></a>.
</p></dd><dt class="description">
<!--l. 120--><p class="noindent" >
<span
class="ecbx-1000">use.local.desc</span> </p></dt><dd
class="description">
<!--l. 120--><p class="noindent" >Contains descriptions of valid local USE flags for this repository, along with the
packages to which they apply. The format is as described in section <a
href="#x1-350004.4.3">4.4.3<!--tex4ht:ref: sec:use.desc --></a>.
</p></dd><dt class="description">
<!--l. 122--><p class="noindent" >
<span
class="ecbx-1000">desc/</span> </p></dt><dd
class="description">
<!--l. 122--><p class="noindent" >This directory contains files analogous to <span
class="ectt-1000">use.desc </span>for the various <span
class="ectt-1000">USE_EXPAND</span>
variables. Each file in it is named <span
class="ectt-1000"><varname>.desc</span>, where <span
class="ectt-1000"><varname> </span>is the variable
name, in lowercase, whose possible values the file describes. The format of each file is
as for <span
class="ectt-1000">use.desc</span>, described in section <a
href="#x1-350004.4.3">4.4.3<!--tex4ht:ref: sec:use.desc --></a>. The <span
class="ectt-1000">USE_EXPAND </span>name is <span
class="ecti-1000">not </span>included as
a prefix here.
</p></dd><dt class="description">
<!--l. 127--><p class="noindent" >
<span
class="ecbx-1000">updates/</span> </p></dt><dd
class="description">
<!--l. 127--><p class="noindent" >This directory is described in section <a
href="#x1-360004.4.4">4.4.4<!--tex4ht:ref: sec:updates-dir --></a>.</p></dd></dl>
<div class="table">
<!--l. 131--><p class="noindent" ><a
id="x1-32001r1"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Table 4.1: </span><span
class="content">EAPIs supporting a directory for <span
class="ectt-1000">package.mask</span></span></div><!--tex4ht:label?: x1-32001r1 -->
<div class="tabular">
<table id="TBL-2" class="tabular"
><colgroup id="TBL-2-1g"><col
id="TBL-2-1" /><col
id="TBL-2-2" /></colgroup><tr
style="vertical-align:baseline;" id="TBL-2-1-"><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-1"
class="td11"> <div class="multicolumn" style="white-space:nowrap; text-align:center;"><span
class="ecbx-1000">EAPI</span></div> </td><td style="white-space:nowrap; text-align:center;" id="TBL-2-1-2"
class="td11"> <div class="multicolumn" style="white-space:nowrap; text-align:center;"><span
class="ectt-1000">package.mask </span><span
class="ecbx-1000">can be a directory?</span></div>
</td></tr><tr
style="vertical-align:baseline;" id="TBL-2-2-"><td style="white-space:nowrap; text-align:left;" id="TBL-2-2-1"
class="td11"> 0, 1, 2, 3, 4, 5, 6 </td><td style="white-space:nowrap; text-align:left;" id="TBL-2-2-2"
class="td11"> No </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-3-"><td style="white-space:nowrap; text-align:left;" id="TBL-2-3-1"
class="td11"> 7, 8 </td><td style="white-space:nowrap; text-align:left;" id="TBL-2-3-2"
class="td11"> Yes </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-4-"><td style="white-space:nowrap; text-align:left;" id="TBL-2-4-1"
class="td11"> </td></tr></table></div>
</div><hr class="endfloat" />
</div>
<h4 class="subsectionHead"><span class="titlemark">4.4.1 </span> <a
id="x1-330004.4.1"></a>The profiles.desc file</h4>
<!--l. 146--><p class="noindent" ><span
class="ectt-1000">profiles.desc </span>is a line-based file, with the standard commenting rules from section <a
href="#x1-320004.4">4.4<!--tex4ht:ref: sec:profiles-dir --></a>,
containing a list of profiles that are valid for use, along with their associated architecture and
status. Each line has the format:
</p>
<pre class="verbatim" id="verbatim-1">
<keyword> <profile path> <stability></pre>
<!--l. 153--><p class="nopar" >
</p><!--l. 155--><p class="noindent" >Where:
</p><!--l. 158--><p class="noindent" >
</p><ul>
<li class="compactitem"><span
class="ectt-1000"><keyword> </span>is the default keyword for the profile and the <span
class="ectt-1000">ARCH </span>for which the profile is
valid.
</li>
<li class="compactitem"><span
class="ectt-1000"><profile path> </span>is the (relative) path from the <span
class="ectt-1000">profiles </span>directory to the profile in
question.
</li>
<li class="compactitem"><span
class="ectt-1000"><stability> </span>indicates the stability of the profile. This may be useful for QA tools,
which may wish to display warnings with a reduced severity for some profiles. The
values <span
class="ectt-1000">stable </span>and <span
class="ectt-1000">dev </span>are widely used, but repositories may use other values.</li></ul>
<!--l. 167--><p class="noindent" >Fields are whitespace-delimited.
</p>
<h4 class="subsectionHead"><span class="titlemark">4.4.2 </span> <a
id="x1-340004.4.2"></a>The thirdpartymirrors file</h4>
<!--l. 171--><p class="noindent" ><span
class="ectt-1000">thirdpartymirrors </span>is another simple line-based file, describing the valid mirrors for use with
<span
class="ectt-1000">mirror:// </span>URIs in this repository, and the associated download locations. The format of each line
is:
</p>
<pre class="verbatim" id="verbatim-2">
<mirror name> <mirror 1> <mirror 2> ... <mirror n></pre>
<!--l. 176--><p class="nopar" > Fields are whitespace-delimited. When parsing a URI of the form <span
class="ectt-1000">mirror://name/path/filename</span>,
where the <span
class="ectt-1000">path/ </span>part is optional, the <span
class="ectt-1000">thirdpartymirrors </span>file is searched for a line whose first field
is <span
class="ectt-1000">name</span>. Then the download URIs in the subsequent fields have <span
class="ectt-1000">path/filename </span>appended to them
to generate the URIs from which a download is attempted.
</p><!--l. 183--><p class="noindent" >Each mirror name may appear at most once in a file. Behaviour when a mirror name appears
multiple times is undefined. Behaviour when a mirror is defined in terms of another mirror is
undefined. A package manager may choose to fetch from all of or a subset of the listed mirrors, and
may use an order other than the one described.
</p><!--l. 188--><p class="noindent" >The mirror with the name equal to the repository’s name (and if the repository has a master, the
master’s name) may be consulted for all downloads.
</p><!--l. 191--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">4.4.3 </span> <a
id="x1-350004.4.3"></a>use.desc and related files</h4>
<!--l. 193--><p class="noindent" ><span
class="ectt-1000">use.desc </span>contains descriptions of every valid global USE flag for this repository. It is a
line-based file with the standard rules for comments and blank lines. The format of each line
is:
</p>
<pre class="verbatim" id="verbatim-3">
<flagname> - <description></pre>
<!--l. 197--><p class="nopar" >
</p><!--l. 199--><p class="noindent" ><span
class="ectt-1000">use.local.desc </span>contains descriptions of every valid local USE flag—those that apply only to a
small number of packages, or that have different meanings for different packages. Its format
is:
</p>
<pre class="verbatim" id="verbatim-4">
<category/package>:<flagname> - <description></pre>
<!--l. 203--><p class="nopar" > Flags must be listed once for each package to which they apply, or if a flag is listed in both
<span
class="ectt-1000">use.desc </span>and <span
class="ectt-1000">use.local.desc</span>, it must be listed once for each package for which its meaning
differs from that described in <span
class="ectt-1000">use.desc</span>.
</p><!--l. 208--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">4.4.4 </span> <a
id="x1-360004.4.4"></a>The updates directory</h4>
<!--l. 210--><p class="noindent" ><span class="fbox"><span
class="eccc1000-"><span
class="small-caps">updates-filenames</span></span></span> The <span
class="ectt-1000">updates </span>directory is used to inform the package manager that a
package has moved categories, names, or that a version has changed SLOT. For EAPIs so
specified by table <a
href="#x1-36001r2">4.2<!--tex4ht:ref: tab:updates-filenames --></a>, it contains one file per quarter year, named <span
class="ectt-1000">[1-4]Q-[YYYY] </span>for
the first to fourth quarter of a given year, for example <span
class="ectt-1000">1Q-2004 </span>or <span
class="ectt-1000">3Q-2006</span>. For other
EAPIs, all regular files in this directory will be processed, unless their name begins with a
dot.
</p><!--l. 217--><p class="noindent" >The format of each file is again line-based, with each line having one of the following
formats:
</p>
<pre class="verbatim" id="verbatim-5">
move <qpn1> <qpn2>
slotmove <spec> <slot1> <slot2></pre>
<!--l. 221--><p class="nopar" > The first form, where <span
class="ectt-1000">qpn1 </span>and <span
class="ectt-1000">qpn2 </span>are <span
class="ecti-1000">qualified package names</span>, instructs the package
manager that the package <span
class="ectt-1000">qpn1 </span>has changed name, category, or both, and is now called
<span
class="ectt-1000">qpn2</span>.
</p><!--l. 225--><p class="noindent" >The second form instructs the package manager that any currently installed package version
matching package dependency specification <span
class="ectt-1000">spec </span>whose <span
class="ectt-1000">SLOT </span>is set to <span
class="ectt-1000">slot1 </span>should have it
updated to <span
class="ectt-1000">slot2</span>.
</p><!--l. 229--><p class="noindent" >It is unspecified in what order the files in the <span
class="ectt-1000">updates </span>directory are processed. Lines within each
file are processed in ascending order.
</p><!--l. 232--><p class="noindent" >Any name that has appeared as the origin of a move must not be reused in the future. Any slot
that has appeared as the origin of a slot move may not be used by packages matching the spec of
that slot move in the future.
</p>
<div class="table">
<!--l. 237--><p class="noindent" ><a
id="x1-36001r2"></a></p><hr class="float" /><div class="float"
>
<div class="caption"
><span class="id">Table 4.2: </span><span
class="content">Naming rules for files in <span
class="ectt-1000">updates </span>directory for EAPIs</span></div><!--tex4ht:label?: x1-36001r2 -->
<div class="tabular">
<table id="TBL-3" class="tabular"
><colgroup id="TBL-3-1g"><col
id="TBL-3-1" /><col
id="TBL-3-2" /></colgroup><tr
style="vertical-align:baseline;" id="TBL-3-1-"><td style="white-space:nowrap; text-align:center;" id="TBL-3-1-1"
class="td11"> <div class="multicolumn" style="white-space:nowrap; text-align:center;"><span
class="ecbx-1000">EAPI</span></div> </td><td style="white-space:nowrap; text-align:center;" id="TBL-3-1-2"
class="td11"> <div class="multicolumn" style="white-space:nowrap; text-align:center;"><span
class="ecbx-1000">Files per quarter year?</span></div>
</td></tr><tr
style="vertical-align:baseline;" id="TBL-3-2-"><td style="white-space:nowrap; text-align:left;" id="TBL-3-2-1"
class="td11"> 0, 1, 2, 3, 4, 5, 6, 7 </td><td style="white-space:nowrap; text-align:left;" id="TBL-3-2-2"
class="td11"> Yes </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-3-3-"><td style="white-space:nowrap; text-align:left;" id="TBL-3-3-1"
class="td11"> 8 </td><td style="white-space:nowrap; text-align:left;" id="TBL-3-3-2"
class="td11"> No </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-3-4-"><td style="white-space:nowrap; text-align:left;" id="TBL-3-4-1"
class="td11"> </td></tr></table></div>
</div><hr class="endfloat" />
</div>
<h3 class="sectionHead"><span class="titlemark">4.5 </span> <a
id="x1-370004.5"></a>The Licenses Directory</h3>
<!--l. 253--><p class="noindent" >The <span
class="ectt-1000">licenses </span>directory shall contain copies of the licenses used by packages in the repository.
Each file will be named according to the name used in the <span
class="ectt-1000">LICENSE </span>variable as described in
section <a
href="#x1-620007.3">7.3<!--tex4ht:ref: sec:optional-vars --></a>, and will contain the complete text of the license in human-readable form. Plain text
format is strongly preferred but not required.
</p><!--l. 258--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">4.6 </span> <a
id="x1-380004.6"></a>The Eclass Directory</h3>
<!--l. 261--><p class="noindent" >The <span
class="ectt-1000">eclass </span>directory shall contain copies of the eclasses provided by this repository. The format of
these files is described in chapter <a
href="#x1-10400010">10<!--tex4ht:ref: ch:eclasses --></a>. It may also contain, in their own directory, support files
needed by these eclasses.
</p><!--l. 265--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">4.7 </span> <a
id="x1-390004.7"></a>The Metadata Directory</h3>
<!--l. 268--><p class="noindent" >The <span
class="ectt-1000">metadata </span>directory contains various repository-level metadata that is not contained in
<span
class="ectt-1000">profiles/</span>. All contents are optional. In this standard only the <span
class="ectt-1000">cache </span>subdirectory is described;
other contents are optional but may include security advisories, DTD files for the various XML
files used in the repository, and repository timestamps.
</p><!--l. 273--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">4.7.1 </span> <a
id="x1-400004.7.1"></a>The metadata cache</h4>
<!--l. 275--><p class="noindent" >The <span
class="ectt-1000">metadata/cache </span>directory may contain a cached form of all important ebuild metadata
variables. The contents of this directory are described in chapter <a
href="#x1-15100014">14<!--tex4ht:ref: ch:metadata-cache --></a>.
</p>
<h2 class="chapterHead"><span class="titlemark">Chapter 5</span><br /><a
id="x1-410005"></a>Profiles</h2>
<h3 class="sectionHead"><span class="titlemark">5.1 </span> <a
id="x1-420005.1"></a>General Principles</h3>
<!--l. 5--><p class="noindent" >Generally, a profile defines information specific to a certain ‘type’ of system—it lies somewhere
between repository-level defaults and user configuration in that the information it contains is not
necessarily applicable to all machines, but is sufficiently general that it should not be left to the
user to configure it. Some parts of the profile can be overridden by user configuration, some only by
another profile.
</p><!--l. 11--><p class="noindent" >The format of a profile is relatively simple. Each profile is a directory containing any number of the
files described in this chapter, and possibly inheriting another profile. The files themselves
follow a few basic conventions as regards inheritance and format; these are described in
the next section. It may also contain any number of subdirectories containing other
profiles.
</p><!--l. 16--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">5.2 </span> <a
id="x1-430005.2"></a>Files That Make up a Profile</h3>
<!--l. 18--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">5.2.1 </span> <a
id="x1-440005.2.1"></a>The parent file</h4>
<!--l. 19--><p class="noindent" >A profile may contain a <span
class="ectt-1000">parent </span>file. Each line must contain a relative path to another profile which
will be considered as one of this profile’s parents. Any settings from the parent are inherited by
this profile, and can be overridden by it. Precise rules for how settings are combined with the
parent profile vary between files, and are described below. Parents are handled depth
first, left to right, with duplicate parent paths being sourced for every time they are
encountered.
</p><!--l. 25--><p class="noindent" >It is illegal for a profile’s parent tree to contain cycles. Package manager behaviour upon
encountering a cycle is undefined.
</p><!--l. 28--><p class="noindent" >This file must not contain comments, blank lines or make use of line continuations.
</p><!--l. 30--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">5.2.2 </span> <a
id="x1-450005.2.2"></a>The eapi file</h4>
<!--l. 32--><p class="noindent" >A profile directory may contain an <span
class="ectt-1000">eapi </span>file. This file, if it exists, must contain a single line with
the name of an EAPI. This specifies the EAPI to use when handling the directory in question; a
package manager must not attempt to use any profile using a directory which requires an EAPI it
does not support. If no <span
class="ectt-1000">eapi </span>file is present, EAPI 0 shall be used. The EAPI is neither inherited
via the <span
class="ectt-1000">parent </span>file nor in subdirectories.
</p><!--l. 38--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">5.2.3 </span> <a
id="x1-460005.2.3"></a>deprecated</h4>
<!--l. 39--><p class="noindent" >If a profile contains a file