public inbox for gentoo-pms@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-pms] Some improvements
@ 2009-02-18 16:53 Christian Faulhammer
  2009-02-18 18:54 ` David Leverton
  2009-02-18 19:15 ` Ciaran McCreesh
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Faulhammer @ 2009-02-18 16:53 UTC (permalink / raw
  To: gentoo-pms


[-- Attachment #1.1: Type: text/plain, Size: 691 bytes --]

Hi,

another round for my patch burst.  Comment, apply or die.

Visual appearance of variables or options (minor changes)
Patches 01--07

punt table default-function-table, as the contents corresponds with
default-phase-function-table
Patches 08 and 21

Page header, looks nicer in my eyes (and one bug fix introduced by my
patch)
Patches 09 and 12

Prefix labels and references with sec:, tab: alg: etc.
Patch 10

Fix all of the above
Patches 13--20

Generate date on titlepage from last commit
Patch 11

V-Li

-- 
Christian Faulhammer, Gentoo Lisp project
<URL:http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode

<URL:http://www.faulhammer.org/>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: pms-01.patch --]
[-- Type: text/x-patch, Size: 941 bytes --]

From 3a118fea928102c3fdb045215a7185aaa8e3ee2a Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:07:15 +0100
Subject: [PATCH] Do not prefix a variable with a dollar sign for consistency

---
 ebuild-functions.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ebuild-functions.tex b/ebuild-functions.tex
index 2c094b0..8f6dcc7 100644
--- a/ebuild-functions.tex
+++ b/ebuild-functions.tex
@@ -253,7 +253,7 @@ The \t{src\_test} function may be disabled by \t{RESTRICT}. See section~\ref{res
 \label{src-install-function}
 
 The \t{src\_install} function installs the package's content to a directory specified in
-\t{\${D}}.
+\t{D}.
 
 The initial working directory must be \t{S} if that exists, falling back to \t{WORKDIR} otherwise.
 The default implementation used when the ebuild lacks the \t{src\_install} function is a no-op.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: pms-02.patch --]
[-- Type: text/x-patch, Size: 1168 bytes --]

From e9ce6b7fe7fe57b9b5d2f3a8919b316677db2b72 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:07:24 +0100
Subject: [PATCH] Do not prefix a variable with a dollar sign for consistency

---
 pkg-mgr-commands.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index f960651..e2a6863 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -50,7 +50,7 @@ these commands in parallel with any other package manager command. Ebuilds must
 these commands once the current phase function has returned.
 \begin{description}
 \item[has\_version] Takes exactly one package dependency specification as an argument. Returns
-    true if a package matching the atom is installed in \t{\$ROOT}, and false otherwise.
+    true if a package matching the atom is installed in \t{ROOT}, and false otherwise.
 \item[best\_version] Takes exactly one package dependency specification as an argument. If a
     matching package is installed, prints the category, package name and version of the highest
     matching version.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.4: pms-03.patch --]
[-- Type: text/x-patch, Size: 1181 bytes --]

From 304314cba5f58c85a921729923735bbd6ea72ee2 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:08:46 +0100
Subject: [PATCH] Do not prefix a variable with a dollar sign for consistency

---
 pkg-mgr-commands.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index e2a6863..8fe5468 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -159,7 +159,7 @@ emake \
 \subsubsection{Installation commands}
 These commands are used to install files into the staging area, in cases where the package's \t{make
 install} target cannot be used or does not install all needed files. Except where otherwise stated,
-all filenames created or modified are relative to the staging directory, given by \t{\$\{D\}}. These
+all filenames created or modified are relative to the staging directory, given by \t{D}. These
 commands must all be external programs and not bash functions or aliases---that is, they must be
 callable from \t{xargs}. Ebuilds must not run any of these commands once the current phase function
 has returned.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.5: pms-04.patch --]
[-- Type: text/x-patch, Size: 1324 bytes --]

From c09d0c575a2f7ca6120b293e2a2f36b1b8bad644 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:09:22 +0100
Subject: [PATCH] Add curly braces to make variables look Gentoo-like

---
 pkg-mgr-commands.tex |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 8fe5468..838e8cf 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -173,9 +173,9 @@ has returned.
 \item[dodir] Creates the given directories, by default with file mode \t{0755}. This can be overridden
     by setting \t{DIROPTIONS} with the \t{diropts} function.
 
-\item[dodoc] Installs the given files into a subdirectory under \t{/usr/share/doc/\$PF/}. The
+\item[dodoc] Installs the given files into a subdirectory under \t{/usr/share/doc/\$\{PF\}/}. The
     subdirectory is set by the most recent call to \t{docinto}. If \t{docinto} has not
-    yet been called, instead installs to the directory \t{/usr/share/doc/\$PF/}.
+    yet been called, instead installs to the directory \t{/usr/share/doc/\$\{PF\}/}.
 
 \item[doexe] Installs the given files into the directory specified by the most recent
     \t{exeinto} call. If \t{exeinto} has not yet been called, behaviour is undefined.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.6: pms-05.patch --]
[-- Type: text/x-patch, Size: 1623 bytes --]

From 4b5e73abedb765c971d2b74dbe3ff220c73fe00b Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:09:46 +0100
Subject: [PATCH] Do not prefix a variable with a dollar sign for consistency

---
 pkg-mgr-commands.tex |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 838e8cf..7b0cd84 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -190,7 +190,7 @@ has returned.
 }
 
 \item[dohtml] Installs the given HTML files into a subdirectory under \t{/usr/share/doc/\$PF/}.
-The subdirectory is \t{html} by default, but this can be changed by the \t{\$DOCDESTTREE}
+The subdirectory is \t{html} by default, but this can be changed by the \t{DOCDESTTREE}
 variable. Files to be installed automatically are determined by extension and the default
 extensions are \t{css}, \t{gif}, \t{htm}, \t{html}, \t{jpeg}, \t{jpg}, \t{js} and \t{png}. These default
 extensions can be extended or reduced (see below). The options that can be passed to \t{dohtml}
@@ -217,7 +217,7 @@ are as follows:
 
 \item[doinitd] Installs an initscript into \t{/etc/init.d}.
 
-\item[doins] Takes any number of files as arguments and installs them into \t{\$INSDESTTREE}\@. If
+\item[doins] Takes any number of files as arguments and installs them into \t{INSDESTTREE}\@. If
     the first argument is \t{-r}, then operates recursively, descending into any directories given.
 
 \item[dolib] For each argument, installs it into the appropriate library directory as determined by
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.7: pms-06.patch --]
[-- Type: text/x-patch, Size: 1557 bytes --]

From fb2370721fcc25a8de710e506477ce166f4e9131 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:11:19 +0100
Subject: [PATCH] Add curly braces to prevent ligatures in --

---
 pkg-mgr-commands.tex |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 7b0cd84..859c775 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -401,11 +401,11 @@ is made.
 \item[use\_with] Has one-, two-, and three-argument forms. The first argument is a USE flag name,
     the second a \t{configure} option name (\t{\$opt}), defaulting to the same as the first argument
     if not provided, and the third is a string value (\t{\$value}), defaulting to nothing. If the
-    USE flag is set, outputs \t{--with-\$opt=\$value} if the third argument was provided, and
-    \t{--with-\$opt} otherwise. If the flag is not set, then it outputs \t{--without-\$opt}.
+    USE flag is set, outputs \t{-{}-with-\$opt=\$value} if the third argument was provided, and
+    \t{-{}-with-\$opt} otherwise. If the flag is not set, then it outputs \t{-{}-without-\$opt}.
 
-\item[use\_enable] Works the same as \t{use\_with()}, but outputs \t{--enable-} or \t{--disable-}
-instead of \t{--with-} or \t{--without-}.
+\item[use\_enable] Works the same as \t{use\_with()}, but outputs \t{-{}-enable-} or \t{-{}-disable-}
+instead of \t{-{}-with-} or \t{-{}-without-}.
 \end{description}
 
 \subsubsection{Misc Commands}
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.8: pms-07.patch --]
[-- Type: text/x-patch, Size: 1655 bytes --]

From 0ff7ed3644a57a4be185023bce2c2a866484fd61 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:13:28 +0100
Subject: [PATCH] Add curly braces to make variables look more Gentoo-like

---
 pkg-mgr-commands.tex |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 859c775..d26a8a7 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -399,10 +399,10 @@ is made.
 \item[hasq] Deprecated synonym for \t{has}.
 \\
 \item[use\_with] Has one-, two-, and three-argument forms. The first argument is a USE flag name,
-    the second a \t{configure} option name (\t{\$opt}), defaulting to the same as the first argument
-    if not provided, and the third is a string value (\t{\$value}), defaulting to nothing. If the
-    USE flag is set, outputs \t{-{}-with-\$opt=\$value} if the third argument was provided, and
-    \t{-{}-with-\$opt} otherwise. If the flag is not set, then it outputs \t{-{}-without-\$opt}.
+    the second a \t{configure} option name (\t{\$\{opt\}}), defaulting to the same as the first argument
+    if not provided, and the third is a string value (\t{\$\{value\}}), defaulting to nothing. If the
+    USE flag is set, outputs \t{-{}-with-\$\{opt\}=\$\{value\}} if the third argument was provided, and
+    \t{-{}-with-\$\{opt\}} otherwise. If the flag is not set, then it outputs \t{-{}-without-\$\{opt\}}.
 
 \item[use\_enable] Works the same as \t{use\_with()}, but outputs \t{-{}-enable-} or \t{-{}-disable-}
 instead of \t{-{}-with-} or \t{-{}-without-}.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.9: pms-08.patch --]
[-- Type: text/x-patch, Size: 2007 bytes --]

From 901ab2f32dd7ce09bb73addbd13ed60e8d54b633 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 21:16:14 +0100
Subject: [PATCH] default-phase-function-table and default-function-table are the same,
 so why not reuse it?

---
 pkg-mgr-commands.tex |   30 +-----------------------------
 1 files changed, 1 insertions(+), 29 deletions(-)

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index d26a8a7..8b47826 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -462,37 +462,9 @@ has returned.
 
 \item[default] Calls the \t{default\_} function for the current phase (see section~\ref{default-phase-functions}).
     Must not be called if the \t{default\_} function does not exist for the current phase in the current EAPI.
-    Only available in EAPIs listed in table~\ref{default-function-table}.
+    Only available in EAPIs listed in table~\ref{default-phase-function-table}.
 \end{description}
 
-\begin{centertable}{EAPIs supporting the \t{default} function} \label{default-function-table}
-\IFKDEBUILDELSE
-{
-    \begin{tabular}{ l l }
-        \toprule
-            \multicolumn{1}{c}{\textbf{EAPI}} &
-            \multicolumn{1}{c}{\textbf{Supports \t{default} function?}} \\
-            \midrule
-    \t{0} & No \\
-    \t{1} & No \\
-    \t{kdebuild-1} & No \\
-    \t{2} & Yes \\
-    \bottomrule
-    \end{tabular}
-}{
-    \begin{tabular}{ l l }
-        \toprule
-            \multicolumn{1}{c}{\textbf{EAPI}} &
-            \multicolumn{1}{c}{\textbf{Supports \t{default} function?}} \\
-            \midrule
-    \t{0} & No \\
-    \t{1} & No \\
-    \t{2} & Yes \\
-    \bottomrule
-    \end{tabular}
-}
-\end{centertable}
-
 \subsubsection{Debug Commands}
 The following commands are available for debugging. Normally all of these commands should be no ops;
 a package manager may provide a special debug mode where these commands instead do something.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.10: pms-09.patch --]
[-- Type: text/x-patch, Size: 980 bytes --]

From cc94b6f02159970220d975e385a9d60f112edc8d Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 22:09:16 +0100
Subject: [PATCH] Add a header to the pages (looks nicer in my eyes): typearea.sty
 calculates the page layout in a consistent way

---
 pms.tex |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/pms.tex b/pms.tex
index 09a8ea6..99f5fa8 100644
--- a/pms.tex
+++ b/pms.tex
@@ -19,6 +19,7 @@
   algorithm,
   algorithmic
 }
+\usepackage[DIV13]{typearea}
 \usepackage[position=top]{caption}
 \usepackage[utf8]{inputenc}
 
@@ -106,6 +107,9 @@
 \title{Package Manager Specification}
 \author{Stephen P. Bennett\\\url{spb@exherbo.org}
 \and Ciaran McCreesh\\\url{ciaran.mccreesh@googlemail.com}}
+\pagestyle{myheadings}
+\markboth{\scshape Package Manager Specification}{\scshape Package
+  Manager Specification \chaptermark}
 
 \begin{document}
 \maketitle
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.11: pms-10.patch --]
[-- Type: text/x-patch, Size: 86860 bytes --]

From 703aab4e980368089a412a4e5019b274924ecc89 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Tue, 17 Feb 2009 22:29:05 +0100
Subject: [PATCH] Make labels and references canonical with proper prefixing

---
 appendices.tex            |    4 +-
 credits.tex               |    6 +-
 dependencies.tex          |   72 ++++++++++++++++----------------
 eapi-differences.tex      |  102 ++++++++++++++++++++++----------------------
 ebuild-env-commands.tex   |    4 +-
 ebuild-env-invariancy.tex |    2 +-
 ebuild-env-state.tex      |    4 +-
 ebuild-env-vars.tex       |    8 ++--
 ebuild-format.tex         |    6 +-
 ebuild-functions.tex      |   78 +++++++++++++++++-----------------
 ebuild-vars.tex           |   58 +++++++++++++-------------
 eclasses.tex              |   10 ++--
 glossary.tex              |    4 +-
 introduction.tex          |    4 +-
 merge.tex                 |    4 +-
 names.tex                 |   12 +++---
 pkg-mgr-commands.tex      |   38 ++++++++--------
 profile-variables.tex     |    6 +-
 profiles.tex              |   14 +++---
 tree-layout.tex           |   62 ++++++++++++++--------------
 virtuals.tex              |   12 +++---
 21 files changed, 255 insertions(+), 255 deletions(-)

diff --git a/appendices.tex b/appendices.tex
index 960d4ee..8a224d4 100644
--- a/appendices.tex
+++ b/appendices.tex
@@ -1,7 +1,7 @@
 \appendix
 
 \chapter{metadata.xml}
-\label{metadata-xml}
+\label{sec:metadata-xml}
 
 The \t{metadata.xml} file is used to contain extra package- or category-level information beyond
 what is stored in ebuild metadata. Its exact format is strictly beyond the scope of this document,
@@ -54,7 +54,7 @@ it must not be used.
 
 \IFKDEBUILDELSE
 {
-    The \t{scm} version rules specified in section~\ref{scm-versions} solve all of these issues.
+    The \t{scm} version rules specified in section~\ref{sec:scm-versions} solve all of these issues.
 }{
 }
 
diff --git a/credits.tex b/credits.tex
index d2d8b6c..e9b1ced 100644
--- a/credits.tex
+++ b/credits.tex
@@ -1,8 +1,8 @@
 \section*{Acknowledgements}
 
-Thanks to Mike Kelly (package manager provided utilities, section~\ref{pkg-mgr-commands}), Danny van
-Dyk (ebuild functions, section~\ref{ebuild-functions}), David Leverton (various sections) and
-Petteri Räty (environment state, section~\ref{ebuild-env-state}) for contributions. Thanks to
+Thanks to Mike Kelly (package manager provided utilities, section~\ref{sec:pkg-mgr-commands}), Danny van
+Dyk (ebuild functions, section~\ref{sec:ebuild-functions}), David Leverton (various sections) and
+Petteri Räty (environment state, section~\ref{sec:ebuild-env-state}) for contributions. Thanks to
 Christian Faulhammer for fixing some of the more horrible formatting screwups. Thanks also to Mike
 Frysinger and Brian Harring for proof-reading and suggestions for fixes and/or clarification.
 
diff --git a/dependencies.tex b/dependencies.tex
index e28589b..5d37e6f 100644
--- a/dependencies.tex
+++ b/dependencies.tex
@@ -1,5 +1,5 @@
 \chapter{Dependencies}
-\label{dependencies}
+\label{sec:dependencies}
 
 \section{Dependency Classes}
 
@@ -26,9 +26,9 @@ be surrounded on both sides by whitespace, except at the start and end of the st
 \item A simple qualified package name. Permitted in \t{PROVIDE} (and inside \t{DEPEND} etc
     via the previous item).
 \item A URI, in the form \t{proto://host/path}. Permitted in \t{SRC\_URI} and \t{HOMEPAGE}.
-In EAPIs listed in table~\ref{uri-arrows-table} as supporting \t{SRC\_URI} arrows, may
+In EAPIs listed in table~\ref{tab:uri-arrows-table} as supporting \t{SRC\_URI} arrows, may
 optionally be followed by whitespace, then \t{->}, then whitespace, then a simple filename
-when in \t{SRC\_URI}. For \t{SRC\_URI} behaviour, see section~\ref{src-uri-behaviour}.
+when in \t{SRC\_URI}. For \t{SRC\_URI} behaviour, see section~\ref{sec:src-uri-behaviour}.
 \item A flat filename. Permitted in \t{SRC\_URI}.
 \item A license name (e.g. \t{GPL-2}). Permitted in \t{LICENSE}.
 \item A simple string. Permitted in \t{RESTRICT} and \t{PROPERTIES}.
@@ -51,8 +51,8 @@ when in \t{SRC\_URI}. For \t{SRC\_URI} behaviour, see section~\ref{src-uri-behav
 \IFKDEBUILDELSE
 {
     \item A label, which is a string without whitespace followed by a colon. Permitted in
-    \t{SRC\_URI} in EAPIs shown in table~\ref{uri-labels-table} as supporting \t{SRC\_URI} labels,
-    and in \t{PDEPEND} in EAPIs shown in table~\ref{pdepend-labels-table} as supporting \t{PDEPEND}
+    \t{SRC\_URI} in EAPIs shown in table~\ref{tab:uri-labels-table} as supporting \t{SRC\_URI} labels,
+    and in \t{PDEPEND} in EAPIs shown in table~\ref{tab:pdepend-labels-table} as supporting \t{PDEPEND}
     labels.
 }{
 }
@@ -60,7 +60,7 @@ when in \t{SRC\_URI}. For \t{SRC\_URI} behaviour, see section~\ref{src-uri-behav
 
 In particular, note that whitespace is not optional.
 
-\begin{centertable}{EAPIs supporting \t{SRC\_URI} arrows} \label{uri-arrows-table}
+\begin{centertable}{EAPIs supporting \t{SRC\_URI} arrows} \label{tab:uri-arrows-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -90,7 +90,7 @@ In particular, note that whitespace is not optional.
 
 \IFKDEBUILDELSE
 {
-    \begin{centertable}{EAPIs supporting \t{SRC\_URI} labels} \label{uri-labels-table}
+    \begin{centertable}{EAPIs supporting \t{SRC\_URI} labels} \label{tab:uri-labels-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -104,7 +104,7 @@ In particular, note that whitespace is not optional.
     \end{tabular}
     \end{centertable}
 
-    \begin{centertable}{EAPIs supporting \t{PDEPEND} labels} \label{pdepend-labels-table}
+    \begin{centertable}{EAPIs supporting \t{PDEPEND} labels} \label{tab:pdepend-labels-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -143,7 +143,7 @@ An empty any-of group counts as being matched.
 \IFKDEBUILDELSE
 {
     \subsection{Labels}
-    \label{labels}
+    \label{sec:labels}
 
     A label alters the behaviour of any subsequent items (including those inside subgroups) in the
     current group. This is demonstrated by code listing~\ref{lst:labels-listing}.
@@ -162,36 +162,36 @@ error on non-compliant input.
 
 \begin{compactitem}
 \item A simple \t{category/package} name.
-\item An operator, as described in section~\ref{dep-operator}, followed immediately by
+\item An operator, as described in section~\ref{sec:dep-operator}, followed immediately by
     \t{category/package}, followed by a hyphen, followed by a version specification.
 \end{compactitem}
 
-In EAPIs shown in table~\ref{slot-deps-table} as supporting \t{SLOT} dependencies, either of the
+In EAPIs shown in table~\ref{tab:slot-deps-table} as supporting \t{SLOT} dependencies, either of the
 above formats may additionally be suffixed by a \t{:slot} restriction, as described in
-section~\ref{slot-dep}. A package manager must warn or error if slot dependencies are used with an
+section~\ref{sec:slot-dep}. A package manager must warn or error if slot dependencies are used with an
 EAPI not supporting \t{SLOT} dependencies.
 
 \IFKDEBUILDELSE
 {
-    In EAPIs shown in table~\ref{range-deps-table} as supporting ranged dependencies, a
+    In EAPIs shown in table~\ref{tab:range-deps-table} as supporting ranged dependencies, a
     specification that does not use an operator at the start may additionally be suffixed by one
-    \t{[range]} restriction, as described in section~\ref{range-dep}. A package manager must warn or
+    \t{[range]} restriction, as described in section~\ref{sec:range-dep}. A package manager must warn or
     error if this feature is used with an EAPI not supporting ranged dependencies.
 }{
 }
 
 \IFKDEBUILDELSE
 {
-    In EAPIs shown in table~\ref{use-deps-table} as supporting kdebuild-style \t{USE} dependencies,
+    In EAPIs shown in table~\ref{tab:use-deps-table} as supporting kdebuild-style \t{USE} dependencies,
     a specification may additionally be suffixed by one or more kdebuild-style \t{[use]}
-    restrictions, as described in section~\ref{kdebuild-use-dep}. A package manager must warn or
+    restrictions, as described in section~\ref{sec:kdebuild-use-dep}. A package manager must warn or
     error if this feature is used with an EAPI not supporting use dependencies.
 }{
 }
 
-In EAPIs shown in table~\ref{use-deps-table} as supporting 2-style \t{USE} dependencies, a specification
+In EAPIs shown in table~\ref{tab:use-deps-table} as supporting 2-style \t{USE} dependencies, a specification
 may additionally be suffixed by at most one 2-style \t{[use]} restriction, as described in
-section~\ref{use-dep}. A package manager must warn or error if this feature is used with an EAPI
+section~\ref{sec:use-dep}. A package manager must warn or error if this feature is used with an EAPI
 not supporting use dependencies.
 
 \IFKDEBUILDELSE
@@ -202,7 +202,7 @@ not supporting use dependencies.
     \note Order is important. The slot restriction must come before use dependencies.
 }
 
-\begin{centertable}{EAPIs supporting \t{SLOT} dependencies} \label{slot-deps-table}
+\begin{centertable}{EAPIs supporting \t{SLOT} dependencies} \label{tab:slot-deps-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -232,7 +232,7 @@ not supporting use dependencies.
 
 \IFKDEBUILDELSE
 {
-    \begin{centertable}{EAPIs supporting ranged dependencies} \label{range-deps-table}
+    \begin{centertable}{EAPIs supporting ranged dependencies} \label{tab:range-deps-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -250,7 +250,7 @@ not supporting use dependencies.
 
 \IFKDEBUILDELSE
 {
-    \begin{centertable}{EAPIs supporting \t{USE} dependencies} \label{use-deps-table}
+    \begin{centertable}{EAPIs supporting \t{USE} dependencies} \label{tab:use-deps-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -264,7 +264,7 @@ not supporting use dependencies.
     \end{tabular}
     \end{centertable}
 }{
-    \begin{centertable}{EAPIs supporting \t{USE} dependencies} \label{use-deps-table}
+    \begin{centertable}{EAPIs supporting \t{USE} dependencies} \label{tab:use-deps-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -279,7 +279,7 @@ not supporting use dependencies.
 }
 
 \subsubsection{Operators}
-\label{dep-operator}
+\label{sec:dep-operator}
 
 The following operators are available:
 
@@ -311,7 +311,7 @@ following exceptions:
 There are two strengths of block: weak and strong. A weak block may be ignored by the package
 manager, so long as any blocked package will be uninstalled later on. A strong block must not be
 ignored. The mapping from one or two exclamation marks to strength is described in
-table~\ref{bang-strength-table}.
+table~\ref{tab:bang-strength-table}.
 
 \begin{centertable}{Exclamation mark strengths for EAPIs} \label{bang-strength-table}
 \IFKDEBUILDELSE
@@ -344,7 +344,7 @@ table~\ref{bang-strength-table}.
 \end{centertable}
 
 \subsubsection{Slot Dependencies}
-\label{slot-dep}
+\label{sec:slot-dep}
 
 A named slot dependency consists of a colon followed by a slot name. A specification with a named
 slot dependency matches only if the slot of the matched package is equal to the slot specified. If
@@ -374,7 +374,7 @@ the match is treated as unsuccessful.
 \IFKDEBUILDELSE
 {
     \subsubsection{Ranged Dependencies}
-    \label{range-dep}
+    \label{sec:range-dep}
 
     A ranged dependency consists of an open square bracket, followed by zero or more of (a depend
     operator followed by a version spec followed by a logical operator) followed by a depend
@@ -395,7 +395,7 @@ the match is treated as unsuccessful.
 \IFKDEBUILDELSE
 {
     \subsubsection{kdebuild Style Use Dependencies}
-    \label{kdebuild-use-dep}
+    \label{sec:kdebuild-use-dep}
 
     A kdebuild-style use dependency consists of one of the following:
 
@@ -425,7 +425,7 @@ the match is treated as unsuccessful.
 }
 
 \subsubsection{2-Style Use Dependencies}
-\label{use-dep}
+\label{sec:use-dep}
 
 A 2-style use dependency consists of one of the following:
 
@@ -455,7 +455,7 @@ not have the flag in \t{IUSE}.
     \subsection{Package Dependency Labels}
 
     In EAPIs supporting \t{PDEPEND} labels, the following labels are legal. See
-    section~\ref{labels} for label behaviour in general.
+    section~\ref{sec:labels} for label behaviour in general.
 
     \begin{description}
     \item[required] Indicates a required post dependency.
@@ -468,7 +468,7 @@ not have the flag in \t{IUSE}.
 }
 
 \subsection{Restrict}
-\label{restrict}
+\label{sec:restrict}
 
 The following tokens are permitted inside \t{RESTRICT}:
 
@@ -486,7 +486,7 @@ The following tokens are permitted inside \t{RESTRICT}:
 Package managers may recognise other tokens, but ebuilds may not rely upon them being supported.
 
 \subsection{Properties}
-\label{properties}
+\label{sec:properties}
 
 The following tokens are permitted inside \t{PROPERTIES}:
 
@@ -497,7 +497,7 @@ The following tokens are permitted inside \t{PROPERTIES}:
 Ebuilds may not rely upon any token being supported.
 
 \subsection{SRC\_URI}
-\label{src-uri-behaviour}
+\label{sec:src-uri-behaviour}
 
 All filename components that are enabled (i.e. not inside a use-conditional block that is not
 matched) in \t{SRC\_URI} must be available in the \t{DISTDIR} directory. In addition, these
@@ -506,7 +506,7 @@ components are used to make the \t{A} and \t{AA} variables.
 If a component contains a full URI with protocol, that download location must be used. Package
 managers may also consult mirrors for their files.
 
-The special \t{mirror://} protocol must be supported. See section~\ref{thirdpartymirrors} for mirror
+The special \t{mirror://} protocol must be supported. See section~\ref{sec:thirdpartymirrors} for mirror
 details.
 
 If a simple filename rather than a full URI is provided, the package manager can only use mirrors to
@@ -515,10 +515,10 @@ download the file.
 \IFKDEBUILDELSE
 {
     The \t{RESTRICT} metadata key can be used to impose additional restrictions upon downloading---see
-    section~\ref{restrict} for details. Labels also alter behaviour---see below for details.
+    section~\ref{sec:restrict} for details. Labels also alter behaviour---see below for details.
 }{
     The \t{RESTRICT} metadata key can be used to impose additional restrictions upon downloading---see
-    section~\ref{restrict} for details.
+    section~\ref{sec:restrict} for details.
 }
 
 \IFKDEBUILDELSE
@@ -528,7 +528,7 @@ instead be the name on the right of the arrow. When consulting mirrors (except f
 listed on the left of the arrow, if \t{mirror://} is used), the filename to the right of the arrow
 shall be requested instead of the filename in the URI.
 
-In EAPIs supporting labels, the following labels are legal. See section~\ref{labels} for label
+In EAPIs supporting labels, the following labels are legal. See section~\ref{sec:labels} for label
 behaviour in general.
 
 \begin{description}
diff --git a/eapi-differences.tex b/eapi-differences.tex
index 1a41f0a..e1d44fb 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -35,7 +35,7 @@
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{scm} support} &
-    \IFKDEBUILDCOLOUR{table~\ref{scm-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:scm-table}} &
     \IFKDEBUILDCOLOUR{Optional} &
     \IFKDEBUILDCOLOUR{Optional} &
     \IFKDEBUILDCOLOUR{Required} &
@@ -44,40 +44,40 @@
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{File extension} &
-    \IFKDEBUILDCOLOUR{section~\ref{file-extension}} &
+    \IFKDEBUILDCOLOUR{section~\ref{sec:file-extension}} &
     \IFKDEBUILDCOLOUR{\t{.ebuild}} &
     \IFKDEBUILDCOLOUR{\t{.ebuild}} &
     \IFKDEBUILDCOLOUR{\t{.kdebuild-1}} &
     \IFKDEBUILDCOLOUR{\t{.ebuild}} \\
 }{}
 
-\t{IUSE} defaults & table~\ref{iuse-defaults-table} & No & Yes & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Yes} &}{} Yes \\
+\t{IUSE} defaults & table~\ref{tab:iuse-defaults-table} & No & Yes & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Yes} &}{} Yes \\
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{PROVIDE} support} &
-    \IFKDEBUILDCOLOUR{table~\ref{provide-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:provide-table}} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{Yes} \\
 }{}
 
-\t{PROPERTIES} & table~\ref{properties-table} & Optionally & Optionally & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Optionally} &}{} Optionally \\
+\t{PROPERTIES} & table~\ref{tab:properties-table} & Optionally & Optionally & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Optionally} &}{} Optionally \\
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{Pre-source \t{EAPI}} &
-    \IFKDEBUILDCOLOUR{section~\ref{pre-source-eapi}} &
+    \IFKDEBUILDCOLOUR{section~\ref{sec:pre-source-eapi}} &
     \IFKDEBUILDCOLOUR{0 or unset} &
     \IFKDEBUILDCOLOUR{0 or unset} &
     \IFKDEBUILDCOLOUR{kdebuild-1} &
     \IFKDEBUILDCOLOUR{0 or unset} \\
 }{}
 
-\t{SRC\_URI} arrows & table~\ref{uri-arrows-table} & No & No & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Yes} &}{} Yes \\
+\t{SRC\_URI} arrows & table~\ref{tab:uri-arrows-table} & No & No & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Yes} &}{} Yes \\
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{SRC\_URI} labels} &
-    \IFKDEBUILDCOLOUR{table~\ref{uri-labels-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:uri-labels-table}} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{Yes} &
@@ -86,7 +86,7 @@
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{PDEPEND} labels} &
-    \IFKDEBUILDCOLOUR{table~\ref{pdepend-labels-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:pdepend-labels-table}} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{Yes} &
@@ -95,7 +95,7 @@
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{Ranged Dependencies} &
-    \IFKDEBUILDCOLOUR{table~\ref{range-deps-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:range-deps-table}} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{Yes} &
@@ -103,31 +103,31 @@
 }{}
 
 Slot dependencies &
-    table~\ref{slot-deps-table} &
+    table~\ref{tab:slot-deps-table} &
     No &
     \IFKDEBUILDELSE{Named}{Yes} &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Named and Operator} &}{}
     \IFKDEBUILDELSE{Named}{Yes} \\
 
-Use dependencies & table~\ref{use-deps-table} & No & No &
+Use dependencies & table~\ref{tab:use-deps-table} & No & No &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{kdebuild-style} &}{} 2-style \\
 
-\t{!} blockers & table~\ref{bang-strength-table} & Unspecified & Unspecified &
+\t{!} blockers & table~\ref{tab:bang-strength-table} & Unspecified & Unspecified &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Unspecified} &}{} Weak \\
 
-\t{!!} blockers & table~\ref{bang-strength-table} & Forbidden & Forbidden &
+\t{!!} blockers & table~\ref{tab:bang-strength-table} & Forbidden & Forbidden &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{Forbidden} &}{} Strong \\
 
-\t{src\_prepare} & table~\ref{src-prepare-table} & No & No & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{No} &}{} Yes \\
+\t{src\_prepare} & table~\ref{tab:src-prepare-table} & No & No & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{No} &}{} Yes \\
 
-\t{src\_configure} & table~\ref{src-configure-table} & No & No & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{No} &}{} Yes \\
+\t{src\_configure} & table~\ref{tab:src-configure-table} & No & No & \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{No} &}{} Yes \\
 
-\t{src\_compile} style & table~\ref{src-compile-table} & 0 & 1 &
+\t{src\_compile} style & table~\ref{tab:src-compile-table} & 0 & 1 &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{1} &}{} 2 \\
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{src\_test}} &
-    \IFKDEBUILDCOLOUR{table~\ref{test-required-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:test-required-table}} &
     \IFKDEBUILDCOLOUR{User option} &
     \IFKDEBUILDCOLOUR{User option} &
     \IFKDEBUILDCOLOUR{Required} &
@@ -136,20 +136,20 @@ Use dependencies & table~\ref{use-deps-table} & No & No &
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{pkg\_info}} &
-    \IFKDEBUILDCOLOUR{table~\ref{pkg-info-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:pkg-info-table}} &
     \IFKDEBUILDCOLOUR{Installed} &
     \IFKDEBUILDCOLOUR{Installed} &
     \IFKDEBUILDCOLOUR{Both} &
     \IFKDEBUILDCOLOUR{Installed} \\
 }{}
 
-\t{default\_} phase functions & table~\ref{default-phase-function-table} & None & None &
+\t{default\_} phase functions & table~\ref{tab:default-phase-function-table} & None & None &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{None} &}{} \parbox[t]{1in}{\t{pkg\_nofetch}, \t{src\_unpack},
     \t{src\_prepare}, \t{src\_configure}, \t{src\_compile}, \t{src\_test}} \\
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{dohard}} &
-    \IFKDEBUILDCOLOUR{table~\ref{banned-commands-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:banned-commands-table}} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Banned} &
@@ -158,7 +158,7 @@ Use dependencies & table~\ref{use-deps-table} & No & No &
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{dohtml}} &
-    \IFKDEBUILDCOLOUR{table~\ref{banned-commands-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:banned-commands-table}} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Banned} &
@@ -167,26 +167,26 @@ Use dependencies & table~\ref{use-deps-table} & No & No &
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{dosed}} &
-    \IFKDEBUILDCOLOUR{table~\ref{banned-commands-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:banned-commands-table}} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Banned} &
     \IFKDEBUILDCOLOUR{Yes} \\
 }{}
 
-\t{doman} languages & table~\ref{doman-table} & No & No &
+\t{doman} languages & table~\ref{tab:doman-table} & No & No &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{No} &}{} Yes \\
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{\t{dosym} does \t{dodir}} &
-    \IFKDEBUILDCOLOUR{table~\ref{dosym-table}} &
+    \IFKDEBUILDCOLOUR{table~\ref{tab:dosym-table}} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{Yes} &
     \IFKDEBUILDCOLOUR{No} &
     \IFKDEBUILDCOLOUR{Yes} \\
 }{}
 
-\t{default} function & table~\ref{default-function-table} & No & No &
+\t{default} function & table~\ref{tab:default-function-table} & No & No &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{No} &}{} Yes \\
 
 \end{longtable}
@@ -204,9 +204,9 @@ EAPI 0 is the base EAPI.
 EAPI 1 is EAPI 0 with the following changes:
 
 \begin{compactitem}
-\item \t{IUSE} defaults, table~\ref{iuse-defaults-table}.
-\item Slot dependencies, table~\ref{slot-deps-table}.
-\item Different \t{src\_compile} implementation, table~\ref{src-compile-table}.
+\item \t{IUSE} defaults, table~\ref{tab:iuse-defaults-table}.
+\item Slot dependencies, table~\ref{tab:slot-deps-table}.
+\item Different \t{src\_compile} implementation, table~\ref{tab:src-compile-table}.
 \end{compactitem}
 
 \IFKDEBUILDELSE
@@ -216,19 +216,19 @@ EAPI 1 is EAPI 0 with the following changes:
     EAPI kdebuild-1 is EAPI 1 with the following changes:
 
     \begin{compactitem}
-    \item \t{scm} support, table~\ref{scm-table}.
-    \item \t{kdebuild-1} file extension, section~\ref{file-extension}.
-    \item \t{PROVIDE} banned, table~\ref{provide-table}.
-    \item Pre-source EAPI is \t{kdebuild-1}, section~\ref{pre-source-eapi}.
-    \item \t{SRC\_URI} arrows, table~\ref{uri-arrows-table}.
-    \item \t{SRC\_URI} labels, table~\ref{uri-labels-table}.
-    \item \t{PDEPEND} labels, table~\ref{pdepend-labels-table}.
-    \item Ranged dependencies, table~\ref{range-deps-table}.
-    \item Use dependencies, table~\ref{use-deps-table}.
-    \item \t{src\_test} mandatory, table~\ref{test-required-table}.
-    \item \t{pkg\_info} can run on uninstalled packages, table~\ref{pkg-info-table}.
-    \item \t{dohard}, \t{dohtml}, \t{dosed} banned, table~\ref{banned-commands-table}.
-    \item \t{dosym} will not do \t{dodir}, table~\ref{dosym-table}.
+    \item \t{scm} support, table~\ref{tab:scm-table}.
+    \item \t{kdebuild-1} file extension, section~\ref{tab:file-extension}.
+    \item \t{PROVIDE} banned, table~\ref{tab:provide-table}.
+    \item Pre-source EAPI is \t{kdebuild-1}, section~\ref{sec:pre-source-eapi}.
+    \item \t{SRC\_URI} arrows, table~\ref{tab:uri-arrows-table}.
+    \item \t{SRC\_URI} labels, table~\ref{tab:uri-labels-table}.
+    \item \t{PDEPEND} labels, table~\ref{tab:pdepend-labels-table}.
+    \item Ranged dependencies, table~\ref{tab:range-deps-table}.
+    \item Use dependencies, table~\ref{tab:use-deps-table}.
+    \item \t{src\_test} mandatory, table~\ref{tab:test-required-table}.
+    \item \t{pkg\_info} can run on uninstalled packages, table~\ref{tab:pkg-info-table}.
+    \item \t{dohard}, \t{dohtml}, \t{dosed} banned, table~\ref{tab:banned-commands-table}.
+    \item \t{dosym} will not do \t{dodir}, table~\ref{tab:dosym-table}.
     \end{compactitem}
 }{
 }
@@ -238,16 +238,16 @@ EAPI 1 is EAPI 0 with the following changes:
 EAPI 2 is EAPI 1 with the following changes:
 
 \begin{compactitem}
-\item \t{SRC\_URI} arrows, table~\ref{uri-arrows-table}.
-\item Use dependencies, table~\ref{use-deps-table}.
-\item \t{!} and \t{!!} blockers, table~\ref{bang-strength-table}.
-\item \t{src\_prepare}, table~\ref{src-prepare-table}.
-\item \t{src\_configure}, table~\ref{src-configure-table}.
-\item Different \t{src\_compile} implementation, table~\ref{src-compile-table}.
+\item \t{SRC\_URI} arrows, table~\ref{tab:uri-arrows-table}.
+\item Use dependencies, table~\ref{tab:use-deps-table}.
+\item \t{!} and \t{!!} blockers, table~\ref{tab:bang-strength-table}.
+\item \t{src\_prepare}, table~\ref{tab:src-prepare-table}.
+\item \t{src\_configure}, table~\ref{tab:src-configure-table}.
+\item Different \t{src\_compile} implementation, table~\ref{tab:src-compile-table}.
 \item \t{default\_} phase functions for phases \t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare},
-    \t{src\_configure}, \t{src\_compile} and \t{src\_test}; table~\ref{default-phase-function-table}.
-\item \t{doman} languages support, table~\ref{doman-table}.
-\item \t{default} function, table~\ref{default-function-table}.
+    \t{src\_configure}, \t{src\_compile} and \t{src\_test}; table~\ref{tab:default-phase-function-table}.
+\item \t{doman} languages support, table~\ref{tab:doman-table}.
+\item \t{default} function, table~\ref{tab:default-function-table}.
 \end{compactitem}
 
 % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
diff --git a/ebuild-env-commands.tex b/ebuild-env-commands.tex
index 8dd6fe6..065560d 100644
--- a/ebuild-env-commands.tex
+++ b/ebuild-env-commands.tex
@@ -1,5 +1,5 @@
 \section{Available commands}
-\label{ebuild-env-commands}
+\label{sec:ebuild-env-commands}
 
 This section documents the commands available to an ebuild. Unless otherwise specified, they may be
 aliases, shell functions, or executables in the ebuild's \t{PATH}.
@@ -19,7 +19,7 @@ provided by the system profile, or that are provided conditionally based on USE
 dependencies must be used to ensure their presence.
 
 \subsubsection{Guaranteed system commands}
-\label{guaranteed-system-commands}
+\label{sec:guaranteed-system-commands}
 
 The following commands must always be available in the ebuild environment:
 \begin{compactitem}
diff --git a/ebuild-env-invariancy.tex b/ebuild-env-invariancy.tex
index 52839af..f0f5a2d 100644
--- a/ebuild-env-invariancy.tex
+++ b/ebuild-env-invariancy.tex
@@ -1,5 +1,5 @@
 \section{The state of the system between functions}
-\label{ebuild-env-invariancy}
+\label{sec:ebuild-env-invariancy}
 
 For the sake of this section:
 
diff --git a/ebuild-env-state.tex b/ebuild-env-state.tex
index 69aef86..4f31bf2 100644
--- a/ebuild-env-state.tex
+++ b/ebuild-env-state.tex
@@ -1,5 +1,5 @@
 \section{The state of variables between functions}
-\label{ebuild-env-state}
+\label{sec:ebuild-env-state}
 
 Exported and default scope variables are saved between functions. A non-local variable set in a
 function earlier in the call sequence must have its value preserved for later functions, including
@@ -8,7 +8,7 @@ in later functions; variables with default visibility may retain default visibil
 
 Variables with special meanings to the package manager are excluded from this rule.
 
-Global variables must only contain invariant values (see~\ref{metadata-invariance}). If a global
+Global variables must only contain invariant values (see~\ref{sec:metadata-invariance}). If a global
 variable's value is invariant, it may have the value that would be generated at any given point
 in the build sequence.
 
diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex
index f6a16bd..2e8d9af 100644
--- a/ebuild-env-vars.tex
+++ b/ebuild-env-vars.tex
@@ -1,12 +1,12 @@
 \section{Defined Variables}
-\label{ebuild-env-vars}
+\label{sec:ebuild-env-vars}
 
 The package manager must define the following environment variables. Not all variables are
 meaningful in all phases; variables that are not meaningful in a given phase may be unset or set to
 any value. Ebuilds must not attempt to modify any of these variables, unless otherwise specified.
 
 Because of their special meanings, these variables may not be preserved consistently across all
-phases as would normally happen due to environment saving (see~\ref{ebuild-env-state}). For example,
+phases as would normally happen due to environment saving (see~\ref{sec:ebuild-env-state}). For example,
 \t{EBUILD\_PHASE} is different for every phase, and \t{ROOT} may have changed between the various
 different \t{pkg\_*} phases. Ebuilds must recalculate any variable they derive from an inconsistent
 variable.
@@ -33,7 +33,7 @@ variable.
 \endlastfoot
 \t{P} &
     all &
-    No\footnote{May change if a package has been updated (see~\ref{updates-dir})} &
+    No\footnote{May change if a package has been updated (see~\ref{sec:updates-dir})} &
     Package name and version, without the revision part. For example, \t{vim-7.0.174}. \\
 \t{PN} &
     all &
@@ -79,7 +79,7 @@ variable.
     \t{src\_*}\footnote{Not necessarily present when installing from a binary package} &
     No &
     The full path to the package's files directory, used for small support files or
-    patches. See section~\ref{package-dirs}. May or may not exist; if a repository provides no
+    patches. See section~\ref{sec:package-dirs}. May or may not exist; if a repository provides no
     support files for the package in question then an ebuild must be prepared for the situation
     where \t{FILESDIR} points to a non-existent directory. \\
 \t{PORTDIR} &
diff --git a/ebuild-format.tex b/ebuild-format.tex
index 9d034fe..5b63822 100644
--- a/ebuild-format.tex
+++ b/ebuild-format.tex
@@ -1,11 +1,11 @@
 \chapter{Ebuild File Format}
-\label{ebuild-format}
+\label{sec:ebuild-format}
 
 The ebuild file format is in its basic form a subset of the format of a bash script. The interpreter
 is assumed to be GNU bash, version 3.0 or later. The file encoding must be UTF-8 with Unix-style
 newlines. When sourced, the
-ebuild must define certain variables and functions (see sections~\ref{ebuild-vars} and
-\ref{ebuild-functions} for specific information), and must not call any external programs, write
+ebuild must define certain variables and functions (see sections~\ref{sec:ebuild-vars} and
+\ref{sec:ebuild-functions} for specific information), and must not call any external programs, write
 anything to standard output or standard error, or modify the state of the system in any way.
 
 % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
diff --git a/ebuild-functions.tex b/ebuild-functions.tex
index 8f6dcc7..96b202e 100644
--- a/ebuild-functions.tex
+++ b/ebuild-functions.tex
@@ -1,14 +1,14 @@
 \chapter{Ebuild-defined Functions}
-\label{ebuild-functions}
+\label{sec:ebuild-functions}
 
 \section{List of Functions}
-\label{functions}
+\label{sec:functions}
 
 The following is a list of functions that an ebuild, or eclass, may define, and which will be called
 by the package manager as part of the build and/or install process. In all cases the package manager
 must provide a default implementation of these functions; unless otherwise stated this must be a
 no-op. Most functions must assume only that they have write access to the package's working
-directory (the \t{WORKDIR} environment variable; see section~\ref{env-var-WORKDIR}), and the
+directory (the \t{WORKDIR} environment variable; see section~\ref{sec:env-var-WORKDIR}), and the
 temporary directory \t{T}; exceptions are noted below. All functions may assume that they have read
 access to all system libraries, binaries and configuration files that are accessible to normal
 users.
@@ -26,7 +26,7 @@ package, not the current configuration.
 Ebuilds must not call nor assume the existence of any phase functions.
 
 \subsection{pkg\_setup}
-\label{pkg-setup-function}
+\label{sec:pkg-setup-function}
 The \t{pkg\_setup} function sets up the ebuild's environment for all following functions, before
 the build process starts. Further, it checks whether any necessary prerequisites not covered
 by the package manager, e.g.\ that certain kernel configuration options are fulfilled.
@@ -35,7 +35,7 @@ by the package manager, e.g.\ that certain kernel configuration options are fulf
 and/or groups to the system.
 
 \subsection{src\_unpack}
-\label{src-unpack-function}
+\label{sec:src-unpack-function}
 
 The \t{src\_unpack} function extracts all of the package's sources, applies patches and sets up the
 package's build system for further use.
@@ -52,9 +52,9 @@ src_unpack() {
 \end{verbatim}
 
 \subsection{src\_prepare}
-\label{src-prepare-function}
+\label{sec:src-prepare-function}
 
-The \t{src\_prepare} function is only called for EAPIs listed in table~\ref{src-prepare-table} as
+The \t{src\_prepare} function is only called for EAPIs listed in table~\ref{tab:src-prepare-table} as
 supporting it.
 
 The \t{src\_prepare} function can be used for post-unpack source preparation. The default
@@ -62,7 +62,7 @@ implementation does nothing.
 
 The initial working directory must be \t{S} if that exists, falling back to \t{WORKDIR} otherwise.
 
-\begin{centertable}{EAPIs supporting \t{src\_prepare}} \label{src-prepare-table}
+\begin{centertable}{EAPIs supporting \t{src\_prepare}} \label{tab:src-prepare-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -91,9 +91,9 @@ The initial working directory must be \t{S} if that exists, falling back to \t{W
 \end{centertable}
 
 \subsection{src\_configure}
-\label{src-configure-function}
+\label{sec:src-configure-function}
 
-The \t{src\_configure} function is only called for EAPIs listed in table~\ref{src-configure-table} as
+The \t{src\_configure} function is only called for EAPIs listed in table~\ref{tab:src-configure-table} as
 supporting it.
 
 The initial working directory must be \t{S} if that exists, falling back to \t{WORKDIR} otherwise.
@@ -109,7 +109,7 @@ src_configure() {
 }
 \end{verbatim}
 
-\begin{centertable}{EAPIs supporting \t{src\_configure}} \label{src-configure-table}
+\begin{centertable}{EAPIs supporting \t{src\_configure}} \label{tab:src-configure-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -138,14 +138,14 @@ src_configure() {
 \end{centertable}
 
 \subsection{src\_compile}
-\label{src-compile-function}
+\label{sec:src-compile-function}
 
 The \t{src\_compile} function configures the package's build environment in EAPIs lacking
 \t{src\_configure}, and builds the package in all EAPIs.
 
 The initial working directory must be \t{S} if that exists, falling back to \t{WORKDIR} otherwise.
 
-For EAPIs listed in table~\ref{src-compile-table} as using format 0, the default implementation used
+For EAPIs listed in table~\ref{tab:src-compile-table} as using format 0, the default implementation used
 when the ebuild lacks the \t{src\_compile} function shall behave as:
 
 \begin{verbatim}
@@ -159,7 +159,7 @@ src_compile() {
 }
 \end{verbatim}
 
-For EAPIs listed in table~\ref{src-compile-table} as using format 1, the default implementation used
+For EAPIs listed in table~\ref{tab:src-compile-table} as using format 1, the default implementation used
 when the ebuild lacks the \t{src\_compile} function shall behave as:
 
 \begin{verbatim}
@@ -173,7 +173,7 @@ src_compile() {
 }
 \end{verbatim}
 
-For EAPIs listed in table~\ref{src-compile-table} as using format 2, the default implementation used
+For EAPIs listed in table~\ref{tab:src-compile-table} as using format 2, the default implementation used
 when the ebuild lacks the \t{src\_compile} function shall behave as:
 
 \begin{verbatim}
@@ -184,7 +184,7 @@ src_compile() {
 }
 \end{verbatim}
 
-\begin{centertable}{\t{src\_compile} behaviour for EAPIs} \label{src-compile-table}
+\begin{centertable}{\t{src\_compile} behaviour for EAPIs} \label{tab:src-compile-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -213,7 +213,7 @@ src_compile() {
 \end{centertable}
 
 \subsection{src\_test}
-\label{src-test-function}
+\label{sec:src-test-function}
 
 The \t{src\_test} function runs unit tests for the newly built but not yet installed package as
 provided.
@@ -224,15 +224,15 @@ enabled, run \t{make check} if and only if such a target is available, or if not
 if and only such a target is available. In both cases, if make returns non-zero the build must be
 aborted.
 
-The \t{src\_test} function may be disabled by \t{RESTRICT}. See section~\ref{restrict}.
+The \t{src\_test} function may be disabled by \t{RESTRICT}. See section~\ref{sec:restrict}.
 
 \IFKDEBUILDELSE
 {
     In some EAPIs, \t{src\_test} should only be run at user option (and never if restrictions are in
-    place). In others, it must always be run (excepting restrictions). See table~\ref{test-required-table}
+    place). In others, it must always be run (excepting restrictions). See table~\ref{tab:test-required-table}
     for which EAPIs fit into which category.
 
-    \begin{centertable}{EAPIs requiring \t{src\_test}} \label{test-required-table}
+    \begin{centertable}{EAPIs requiring \t{src\_test}} \label{tab:test-required-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -250,7 +250,7 @@ The \t{src\_test} function may be disabled by \t{RESTRICT}. See section~\ref{res
 }
 
 \subsection{src\_install}
-\label{src-install-function}
+\label{sec:src-install-function}
 
 The \t{src\_install} function installs the package's content to a directory specified in
 \t{D}.
@@ -259,7 +259,7 @@ The initial working directory must be \t{S} if that exists, falling back to \t{W
 The default implementation used when the ebuild lacks the \t{src\_install} function is a no-op.
 
 \subsection{pkg\_preinst}
-\label{pkg-preinst-function}
+\label{sec:pkg-preinst-function}
 
 The \t{pkg\_preinst} function performs any special tasks that are required immediately before
 merging the package to the live filesystem. It must not write outside of the directories specified
@@ -269,7 +269,7 @@ by the \t{ROOT} and \t{D} environment variables.
 the \t{ROOT} and \t{D} environment variables.
 
 \subsection{pkg\_postinst}
-\label{pkg-postinst-function}
+\label{sec:pkg-postinst-function}
 
 The \t{pkg\_postinst} function performs any special tasks that are required immediately after
 merging the package to the live filesystem. It must not write outside of the directory specified
@@ -279,7 +279,7 @@ in the \t{ROOT} environment variable.
 below that specified by the \t{ROOT} environment variable.
 
 \subsection{pkg\_prerm}
-\label{pkg-prerm-function}
+\label{sec:pkg-prerm-function}
 
 The \t{pkg\_prerm} function performs any special tasks that are required immediately before
 unmerging the package from the live filesystem. It must not write outside of the directory specified
@@ -289,7 +289,7 @@ by the \t{ROOT} environment variable.
 the \t{ROOT} environment variable.
 
 \subsection{pkg\_postrm}
-\label{pkg-postrm-function}
+\label{sec:pkg-postrm-function}
 
 The \t{pkg\_postrm} function performs any special tasks that are required immediately after
 unmerging the package from the live filesystem. It must not write outside of the directory specified
@@ -299,7 +299,7 @@ by the \t{ROOT} environment variable.
 the \t{ROOT} environment variable.
 
 \subsection{pkg\_config}
-\label{pkg-config-function}
+\label{sec:pkg-config-function}
 
 The \t{pkg\_config} function performs any custom steps required to configure a package after it has been
 fully installed. It is the only ebuild function which may be interactive and prompt for user input.
@@ -307,12 +307,12 @@ fully installed. It is the only ebuild function which may be interactive and pro
 \t{pkg\_config} must be run with full access to all files and directories inside of \t{ROOT}.
 
 \subsection{pkg\_info}
-\label{pkg-info-function}
+\label{sec:pkg-info-function}
 
 \IFKDEBUILDELSE
 {
     The \t{pkg\_info} function may be called by the package manager when displaying information about an
-    installed package. In EAPIs listed in table~\ref{pkg-info-table} as supporting \t{pkg\_info} on
+    installed package. In EAPIs listed in table~\ref{tab:pkg-info-table} as supporting \t{pkg\_info} on
     uninstalled packages, it may also be called by the package manager when displaying information
     about an uninstalled package. In this case, ebuild authors should note that dependencies may not be
     installed.
@@ -325,7 +325,7 @@ fully installed. It is the only ebuild function which may be interactive and pro
 
 \IFKDEBUILDELSE
 {
-    \begin{centertable}{EAPIs supporting \t{pkg\_info} on uninstalled packages} \label{pkg-info-table}
+    \begin{centertable}{EAPIs supporting \t{pkg\_info} on uninstalled packages} \label{tab:pkg-info-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -342,7 +342,7 @@ fully installed. It is the only ebuild function which may be interactive and pro
 }
 
 \subsection{pkg\_nofetch}
-\label{pkg-nofetch-function}
+\label{sec:pkg-nofetch-function}
 
 The \t{pkg\_nofetch} function is run when the fetch phase of an fetch-restricted ebuild is run, and
 the relevant source files are not available. It should direct the user to download all relevant
@@ -351,14 +351,14 @@ source files from their respective locations, with notes concerning licensing if
 \t{pkg\_nofetch} must require no write access to any part of the filesystem.
 
 \subsection{\t{default\_} Phase Functions}
-\label{default-phase-functions}
+\label{sec:default-phase-functions}
 
-In EAPIs listed in table~\ref{default-phase-function-table} as supporting \t{default\_} phase
+In EAPIs listed in table~\ref{tab:default-phase-function-table} as supporting \t{default\_} phase
 functions, a function named \t{default\_}(phase) that behaves as the default
 implementation for that EAPI shall be defined when executing any ebuild phase listed in the table. Ebuilds
 must not call these functions except when in the phase in question.
 
-\begin{centertable}{EAPIs supporting \t{default\_} phase functions} \label{default-phase-function-table}
+\begin{centertable}{EAPIs supporting \t{default\_} phase functions} \label{tab:default-phase-function-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -395,8 +395,8 @@ The call order for installing a package is:
 \begin{compactitem}
 \item \t{pkg\_setup}
 \item \t{src\_unpack}
-\item \t{src\_prepare} (only for EAPIs listed in table~\ref{src-prepare-table})
-\item \t{src\_configure} (only for EAPIs listed in table~\ref{src-configure-table})
+\item \t{src\_prepare} (only for EAPIs listed in table~\ref{tab:src-prepare-table})
+\item \t{src\_configure} (only for EAPIs listed in table~\ref{tab:src-configure-table})
 \item \t{src\_compile}
 \item \t{src\_test} (except if \t{RESTRICT=test})
 \item \t{src\_install}
@@ -416,8 +416,8 @@ The call order for reinstalling a package is:
 \begin{compactitem}
 \item \t{pkg\_setup}
 \item \t{src\_unpack}
-\item \t{src\_prepare} (only for EAPIs listed in table~\ref{src-prepare-table})
-\item \t{src\_configure} (only for EAPIs listed in table~\ref{src-configure-table})
+\item \t{src\_prepare} (only for EAPIs listed in table~\ref{tab:src-prepare-table})
+\item \t{src\_configure} (only for EAPIs listed in table~\ref{tab:src-configure-table})
 \item \t{src\_compile}
 \item \t{src\_test} (except if \t{RESTRICT=test})
 \item \t{src\_install}
@@ -432,8 +432,8 @@ The call order for upgrading or downgrading a package is:
 \begin{compactitem}
 \item \t{pkg\_setup}
 \item \t{src\_unpack}
-\item \t{src\_prepare} (only for EAPIs listed in table~\ref{src-prepare-table})
-\item \t{src\_configure} (only for EAPIs listed in table~\ref{src-configure-table})
+\item \t{src\_prepare} (only for EAPIs listed in table~\ref{tab:src-prepare-table})
+\item \t{src\_configure} (only for EAPIs listed in table~\ref{tab:src-configure-table})
 \item \t{src\_compile}
 \item \t{src\_test} (except if \t{RESTRICT=test})
 \item \t{src\_install}
diff --git a/ebuild-vars.tex b/ebuild-vars.tex
index a79217e..0c5080a 100644
--- a/ebuild-vars.tex
+++ b/ebuild-vars.tex
@@ -1,11 +1,11 @@
 \chapter{Ebuild-defined Variables}
-\label{ebuild-vars}
+\label{sec:ebuild-vars}
 
 \note This section describes variables that may or must be defined by ebuilds. For
-variables that are passed from the package manager to the ebuild, see section~\ref{ebuild-env-vars}.
+variables that are passed from the package manager to the ebuild, see section~\ref{sec:ebuild-env-vars}.
 
 \section{Metadata invariance}
-\label{metadata-invariance}
+\label{sec:metadata-invariance}
 
 All ebuild-defined variables discussed in this chapter must be defined independently of
 any system, profile or tree dependent data, and must not vary depending upon the ebuild
@@ -24,38 +24,38 @@ All ebuilds must define at least the following variables:
 \item[DESCRIPTION] A short human-readable description of the package's purpose. May be defined by an
     eclass. Must not be empty.
 \item[HOMEPAGE] The URI or URIs for a package's homepage, including protocols. May be defined by an
-    eclass. See section~\ref{dependencies} for full syntax.
+    eclass. See section~\ref{sec:dependencies} for full syntax.
 \item[IUSE] The \t{USE} flags used by the ebuild. Historically, \t{USE\_EXPAND} values and \t{ARCH}
     were not included; package managers should support this for backwards compatibility reasons. Ebuilds
     must list only flags used by the ebuild itself. Any eclass that works with \t{USE} flags
     must also set \t{IUSE}, listing only the variables used by that eclass. The package manager is
     responsible for merging these values.
 
-    In EAPIs shown in table~\ref{iuse-defaults-table} as supporting \t{IUSE} defaults, any use flag
+    In EAPIs shown in table~\ref{tab:iuse-defaults-table} as supporting \t{IUSE} defaults, any use flag
     name in \t{IUSE} may be prefixed by at most one of a plus or a minus sign. If such a prefix is
     present, the package manager may use it as a suggestion as to the default value of the use flag
     if no other configuration overrides it.
 \item[KEYWORDS] A whitespace separated list of keywords for the ebuild. Each token must be a
-    valid keyword name, as per section~\ref{keyword-names}. May include \t{-*}, which
+    valid keyword name, as per section~\ref{sec:keyword-names}. May include \t{-*}, which
     indicates that the package will only work on explicitly listed archs. May include \t{-arch},
     which indicates that the package will not work on the specified arch. May be empty, which
     indicates uncertain functionality on any architecture. May be defined in an eclass.
 \item[LICENSE] The package's license. Each text token must correspond to a tree ``licenses/'' entry
-    (see section~\ref{licenses-dir}). See section~\ref{dependencies} for full syntax.
+    (see section~\ref{sec:licenses-dir}). See section~\ref{sec:dependencies} for full syntax.
     May be defined by an eclass. \label{ebuild-var-LICENSE}
-\item[SLOT] The package's slot. Must be a valid slot name, as per section~\ref{slot-names}. May
+\item[SLOT] The package's slot. Must be a valid slot name, as per section~\ref{sec:slot-names}. May
     be defined by an eclass. Must not be empty.
 \item[SRC\_URI] A list of source URIs for the package. Valid protocols are \t{http://},
-    \t{https://}, \t{ftp://} and \t{mirror://} (see section~\ref{thirdpartymirrors} for mirror behaviour).
+    \t{https://}, \t{ftp://} and \t{mirror://} (see section~\ref{sec:thirdpartymirrors} for mirror behaviour).
     Fetch restricted packages may include URL parts consisting of just a filename. See
-    section~\ref{dependencies} for full syntax.
+    section~\ref{sec:dependencies} for full syntax.
 \end{description}
 
 If any of these variables are undefined, or if any of these variables are set to invalid values,
 the package manager's behaviour is undefined; ideally, an error in one ebuild should not prevent
 operations upon other ebuilds or packages.
 
-\begin{centertable}{EAPIs supporting \t{IUSE} defaults} \label{iuse-defaults-table}
+\begin{centertable}{EAPIs supporting \t{IUSE} defaults} \label{tab:iuse-defaults-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -89,28 +89,28 @@ operations upon other ebuilds or packages.
 Ebuilds may define any of the following variables:
 
 \begin{description}
-\item[DEPEND] See section~\ref{dependencies}.
+\item[DEPEND] See section~\ref{sec:dependencies}.
 \item[EAPI] The EAPI. See below for defaults.
-\item[PDEPEND] See section~\ref{dependencies}.
+\item[PDEPEND] See section~\ref{sec:dependencies}.
 \IFKDEBUILDELSE
 {
     \item[PROVIDE] Zero or more qualified package names of any \e{old style}
-        virtuals provided by this package. See section~\ref{dependencies} for full syntax.  In EAPIs
-        listed in table~\ref{provide-table} as not supporting \t{PROVIDE}, ebuilds must not set this
+        virtuals provided by this package. See section~\ref{sec:dependencies} for full syntax.  In EAPIs
+        listed in table~\ref{tab:provide-table} as not supporting \t{PROVIDE}, ebuilds must not set this
         variable and the package manager must reject any ebuild that does so.
         \label{ebuild-var-provide}
 }{
     \item[PROVIDE] Zero or more qualified package names of any \e{old style}
-        virtuals provided by this package. See section~\ref{dependencies} for full syntax.
+        virtuals provided by this package. See section~\ref{sec:dependencies} for full syntax.
         \label{ebuild-var-provide}
 }
-\item[RDEPEND] See section~\ref{dependencies}. \t{RDEPEND} has special behaviour for its value if
-    unset and when used with an eclass. See section~\ref{rdepend-depend} for details.
-\item[RESTRICT] Zero or more behaviour restrictions for this package. See section~\ref{restrict}
-    for value meanings and section~\ref{dependencies} for full syntax.
-\item[PROPERTIES] Zero or more properties for this package. See section~\ref{properties}
-    for value meanings and section~\ref{dependencies} for full syntax. For EAPIs listed in
-    table~\ref{properties-table} as having optional support, ebuilds must not rely upon the
+\item[RDEPEND] See section~\ref{sec:dependencies}. \t{RDEPEND} has special behaviour for its value if
+    unset and when used with an eclass. See section~\ref{sec:rdepend-depend} for details.
+\item[RESTRICT] Zero or more behaviour restrictions for this package. See section~\ref{sec:restrict}
+    for value meanings and section~\ref{sec:dependencies} for full syntax.
+\item[PROPERTIES] Zero or more properties for this package. See section~\ref{sec:properties}
+    for value meanings and section~\ref{sec:dependencies} for full syntax. For EAPIs listed in
+    table~\ref{tab:properties-table} as having optional support, ebuilds must not rely upon the
     package manager recognising or understanding this variable in any way.
 \item[S] The path to the temporary build directory, used by \t{src\_compile}, \t{src\_install}
     etc. Defaults to \t{\$\{WORKDIR\}/\$\{P\}}.
@@ -118,7 +118,7 @@ Ebuilds may define any of the following variables:
 
 \IFKDEBUILDELSE
 {
-    \begin{centertable}{EAPIs supporting \t{PROVIDE}} \label{provide-table}
+    \begin{centertable}{EAPIs supporting \t{PROVIDE}} \label{tab:provide-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -134,7 +134,7 @@ Ebuilds may define any of the following variables:
 }{
 }
 
-\begin{centertable}{EAPIs supporting \t{PROPERTIES}} \label{properties-table}
+\begin{centertable}{EAPIs supporting \t{PROPERTIES}} \label{tab:properties-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -164,7 +164,7 @@ Ebuilds may define any of the following variables:
 \end{centertable}
 
 \subsection{EAPI}
-\label{pre-source-eapi}
+\label{sec:pre-source-eapi}
 
 An empty \t{EAPI} value is equal to \t{0}. Ebuilds must not assume that they will get a particular
 one of these two values if they are expecting one of these two values.
@@ -186,7 +186,7 @@ If any of these variables are set to invalid values, the package manager's behav
 ideally, an error in one ebuild should not prevent operations upon other ebuilds or packages.
 
 \section{\t{RDEPEND} value}
-\label{rdepend-depend}
+\label{sec:rdepend-depend}
 
 If \t{RDEPEND} is unset (but not if it is set to an empty string) in an ebuild, the package manager
 must set its value to be equal to the value of \t{DEPEND}.
@@ -206,7 +206,7 @@ of the ebuild's metadata:
 \item[INHERITED] List of inherited eclass names. Again, this is handled magically by \t{inherit}.
 \end{description}
 
-\note Thus, by extension of section~\ref{metadata-invariance}, \t{inherit} may not be used
+\note Thus, by extension of section~\ref{sec:metadata-invariance}, \t{inherit} may not be used
     conditionally, except upon constant conditions.
 
 The following are special variables defined by the package manager for internal use and may or may
@@ -220,7 +220,7 @@ managers may not rely upon the metadata cache having this variable defined, and
 string as ``this information is not available''.
 \end{description}
 
-\note Thus, by extension of section~\ref{metadata-invariance}, phase functions must not be defined
+\note Thus, by extension of section~\ref{sec:metadata-invariance}, phase functions must not be defined
 based upon any variant condition.
 
 % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
diff --git a/eclasses.tex b/eclasses.tex
index 8d46379..1eb5274 100644
--- a/eclasses.tex
+++ b/eclasses.tex
@@ -1,5 +1,5 @@
 \chapter{Eclasses}
-\label{eclasses}
+\label{sec:eclasses}
 
 Eclasses serve to store common code that is used by more than one ebuild, which greatly aids
 maintainability and reduces the tree size. However, due to metadata cache issues, care must be taken
@@ -8,11 +8,11 @@ using them. The interpreter is therefore the same, and the same requirements for
 hold.
 
 Eclasses must be located in the \t{eclass} directory in the top level of the repository---see
-section~\ref{eclass-dir}. Each eclass is a single file named \t{<name>.eclass}, where \t{<name>} is
+section~\ref{sec:eclass-dir}. Each eclass is a single file named \t{<name>.eclass}, where \t{<name>} is
 the name of this eclass, used by \t{inherit} and \t{EXPORT\_FUNCTIONS} among other places.
 
 \section{The inherit command}
-\label{inherit}
+\label{sec:inherit}
 
 An ebuild wishing to make use of an eclass does so by using the \t{inherit} command in global scope.
 This will cause the eclass to be sourced as part of the ebuild---any function or variable
@@ -38,10 +38,10 @@ The \t{IUSE}, \t{DEPEND}, \t{RDEPEND} and \t{PDEPEND} variables are handled spec
 when set by an eclass. They must be accumulated across eclasses, appending the value set by each
 eclass to the resulting value after the previous one is loaded. Then the eclass-defined value is
 appended to that defined by the ebuild. In the case of \t{RDEPEND}, this is done after the
-implicit \t{RDEPEND} rules in section~\ref{rdepend-depend} are applied.
+implicit \t{RDEPEND} rules in section~\ref{sec:rdepend-depend} are applied.
 \IFKDEBUILDELSE
 {
-    In EAPIs shown in table~\ref{pdepend-labels-table} as supporting \t{PDEPEND}
+    In EAPIs shown in table~\ref{tab:pdepend-labels-table} as supporting \t{PDEPEND}
     labels, the values of \t{PDEPEND} from the ebuild and each eclass must be wrapped
     in parentheses, so that the labels only apply within the ebuild/eclass in which
     they appear.
diff --git a/glossary.tex b/glossary.tex
index bcbc409..1ef41a9 100644
--- a/glossary.tex
+++ b/glossary.tex
@@ -1,5 +1,5 @@
 \chapter{Glossary}
-\label{glossary}
+\label{sec:glossary}
 
 This section contains explanations of some of the terms used in this document whose meaning may not
 be immediately obvious.
@@ -8,7 +8,7 @@ be immediately obvious.
 \item[qualified package name] A package name along with its associated category. For example,
     \t{app-editors/vim} is a qualified package name.
 \item[old-style virtual] An old-style virtual is a psuedo-package which exists if it is listed in an
-    ebuild's \t{PROVIDE} variable. See chapter~\ref{old-virtuals}.
+    ebuild's \t{PROVIDE} variable. See chapter~\ref{sec:old-virtuals}.
 \item[new-style virtual] A new-style virtual is a normal package in the \t{virtual} category which
     installs no files and uses its dependency requirements to pull in a `provider'. This is more
     flexible than the old-style virtuals described above, and requires no special package manager
diff --git a/introduction.tex b/introduction.tex
index 056f515..019157e 100644
--- a/introduction.tex
+++ b/introduction.tex
@@ -7,7 +7,7 @@ well as certain aspects of package manager behaviour required to support such a
 
 This document is \i{not} 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~\ref{glossary}.
+less familiar terms are explained in the Glossary in chapter~\ref{sec:glossary}.
 
 This document does not specify any user or package manager configuration information.
 
@@ -77,7 +77,7 @@ must not use any metadata generated from a package with an unrecognised EAPI.
 The package manager must not attempt to perform any kind of comparison test other than equality upon
 EAPIs.
 
-EAPIs are also used for profile directories, as described in section~\ref{profile-eapi}.
+EAPIs are also used for profile directories, as described in section~\ref{sec:profile-eapi}.
 
 \subsection{Reserved EAPIs}
 
diff --git a/merge.tex b/merge.tex
index 1f88f79..aef0250 100644
--- a/merge.tex
+++ b/merge.tex
@@ -64,11 +64,11 @@ On SELinux systems, the SELinux context must also be preserved. Other file attri
 modification time, may be discarded.
 
 \subsection{Configuration File Protection}
-\label{config-protect}
+\label{sec:config-protect}
 
 The package manager must provide a means to prevent user configuration files from being
 overwritten by any package updates. The profile variables \t{CONFIG\_PROTECT} and
-\t{CONFIG\_PROTECT\_MASK} (section~\ref{profile-variables}) control the paths for which this
+\t{CONFIG\_PROTECT\_MASK} (section~\ref{sec:profile-variables}) control the paths for which this
 must be enforced.
 
 In order to ensure interoperability with configuration update tools, the following scheme must be
diff --git a/names.tex b/names.tex
index 6fba487..0d48b09 100644
--- a/names.tex
+++ b/names.tex
@@ -20,24 +20,24 @@ hyphen, and must not end in a hyphen followed by one or more digits.
 where a \t{category/package} pair is meant.
 
 \subsection{Slot Names}
-\label{slot-names}
+\label{sec:slot-names}
 A slot name may contain any of the characters [\t{A-Za-z0-9+\_.-}]. It must not begin with a
 hyphen or a dot.
 
 \subsection{USE Flag Names}
 A USE flag name may contain any of the characters [\t{A-Za-z0-9+\_@-}]. It must begin with an
 alphanumeric character. Underscores should be considered reserved for \t{USE\_EXPAND}, as
-described in section~\ref{use-expand}.
+described in section~\ref{sec:use-expand}.
 
 \note The at-sign is required for \t{LINGUAS}.
 
 \subsection{Repository Names}
-\label{repository-names}
+\label{sec:repository-names}
 A repository name may contain any of the characters [\t{A-Za-z0-9\_-}]. It must not begin with a
 hyphen.
 
 \subsection{Keyword Names}
-\label{keyword-names}
+\label{sec:keyword-names}
 A keyword name may contain any of the characters [\t{A-Za-z0-9\_-}]. 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 \t{KEYWORDS}, \t{-*} is also acceptable as a keyword, to indicate that
@@ -61,7 +61,7 @@ This may be followed by zero or more of the suffixes \t{\_alpha}, \t{\_beta}, \t
 
 \IFKDEBUILDELSE
 {
-    \label{scm-versions} In ebuilds using EAPIs listed in table~\ref{scm-table} as requiring support
+    \label{scm-versions} In ebuilds using EAPIs listed in table~\ref{tab:scm-table} as requiring support
     for the \t{-scm} suffix, the preceding version syntax may be either replaced or suffixed by a
     \t{scm} part. If both a ``normal'' version and a \t{scm} part are present, they must be
     separated by a hyphen.
@@ -73,7 +73,7 @@ This may optionally be followed by the suffix \t{-r} followed immediately by an
 
 \IFKDEBUILDELSE
 {
-    \begin{centertable}{EAPIs requiring \t{scm} support} \label{scm-table}
+    \begin{centertable}{EAPIs requiring \t{scm} support} \label{tab:scm-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 8b47826..b1ad129 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -1,4 +1,4 @@
-\label{pkg-mgr-commands}
+\label{sec:pkg-mgr-commands}
 
 The following commands will always be available in the ebuild environment, provided by the package
 manager. Except where otherwise noted, they may be internal (shell functions or aliases) or external
@@ -8,12 +8,12 @@ behaviour.
 \IFKDEBUILDELSE
 {
     \subsubsection{Banned commands}
-    \label{banned-commands}
+    \label{sec:banned-commands}
 
     Some commands are banned in some EAPIs. If a banned command is called, the package manager must
     abort the build process indicating an error.
 
-    \begin{centertable}{Banned commands} \label{banned-commands-table}
+    \begin{centertable}{Banned commands} \label{tab:banned-commands-table}
     \begin{tabular}{ l l l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -136,7 +136,7 @@ has returned.
 \item[emake] Calls the \t{\$MAKE} program, or GNU make if the \t{MAKE} variable is unset.  Any
     arguments given are passed directly to the make command, as are the user's chosen \t{MAKEOPTS}\@.
     Arguments given to \t{emake} override user configuration. See also
-    section~\ref{guaranteed-system-commands}. \t{emake} must be an external program and cannot be a
+    section~\ref{sec:guaranteed-system-commands}. \t{emake} must be an external program and cannot be a
     function or alias---it must be callable from e.g. \t{xargs}.
 \item[einstall] A shortcut for the command given in Listing~\ref{lst:einstall}. Any arguments given
     to \t{einstall} are passed verbatim to \t{emake}, as shown.
@@ -183,8 +183,8 @@ has returned.
 \IFKDEBUILDELSE
 {
     \item[dohard] Takes two parameters. Creates a hardlink from the second to the first. In EAPIs
-    listed in table~\ref{banned-commands-table}, this command is banned as per
-    section~\ref{banned-commands}.
+    listed in table~\ref{tab:banned-commands-table}, this command is banned as per
+    section~\ref{sec:banned-commands}.
 }{
     \item[dohard] Takes two parameters. Creates a hardlink from the second to the first.
 }
@@ -208,8 +208,8 @@ are as follows:
 
 \IFKDEBUILDELSE
 {
-    In EAPIs listed in table~\ref{banned-commands-table}, this command is banned as
-    per section ~\ref{banned-commands}.
+    In EAPIs listed in table~\ref{tab:banned-commands-table}, this command is banned as
+    per section ~\ref{sec:banned-commands}.
 }{
 }
 
@@ -221,7 +221,7 @@ are as follows:
     the first argument is \t{-r}, then operates recursively, descending into any directories given.
 
 \item[dolib] For each argument, installs it into the appropriate library directory as determined by
-    Algorithm~\ref{ebuild-libdir}. Any symlinks are installed into the same directory as relative
+    Algorithm~\ref{alg:ebuild-libdir}. Any symlinks are installed into the same directory as relative
     links to their original target.
 
 \item[dolib.so] As for dolib. Installs the file with mode \t{0755}.
@@ -229,7 +229,7 @@ are as follows:
 \item[dolib.a] As for dolib. Installs the file with mode \t{0644}.
 
 \begin{algorithm}
-\caption{Determining the library directory} \label{ebuild-libdir}
+\caption{Determining the library directory} \label{alg:ebuild-libdir}
 \begin{algorithmic}[1]
 \IF{CONF\_LIBDIR\_OVERRIDE is set in the environment}
     \STATE return CONF\_LIBDIR\_OVERRIDE
@@ -252,7 +252,7 @@ are as follows:
 
 \item[doman] Installs a man page into the appropriate subdirectory of \t{/usr/share/man} depending
     upon its apparent section suffix (e.g. \t{foo.1} goes to \t{/usr/share/man/man1/foo.1}.
-    In EAPIs listed in table~\ref{doman-table} as supporting language codes, a man page with
+    In EAPIs listed in table~\ref{tab:doman-table} as supporting language codes, a man page with
     name of the form\t{foo.lang.1} shall go to \t{/usr/share/man/lang/man1/foo.1}, where \t{lang}
     refers to a pair of lower-case ASCII letters optionally followed by an underscore and a pair
     of upper-case ASCII letters.
@@ -267,7 +267,7 @@ are as follows:
 {
     \item[dosym] Creates a symbolic link named as for its second parameter, pointing to the first. If
         the directory containing the new link does not exist, creates it if EAPI is listed in
-        table~\ref{dosym-table} as making the directory, or aborts the build process otherwise.
+        table~\ref{tab:dosym-table} as making the directory, or aborts the build process otherwise.
 }{
     \item[dosym] Creates a symbolic link named as for its second parameter, pointing to the first. If
         the directory containing the new link does not exist, creates it.
@@ -302,7 +302,7 @@ are as follows:
 
 \end{description}
 
-\begin{centertable}{EAPIs supporting \t{doman} languages} \label{doman-table}
+\begin{centertable}{EAPIs supporting \t{doman} languages} \label{tab:doman-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l }
@@ -332,7 +332,7 @@ are as follows:
 
 \IFKDEBUILDELSE
 {
-    \begin{centertable}{EAPIs where \t{dosym} makes the directory} \label{dosym-table}
+    \begin{centertable}{EAPIs where \t{dosym} makes the directory} \label{tab:dosym-table}
     \begin{tabular}{ l l }
         \toprule
         \multicolumn{1}{c}{\textbf{EAPI}} &
@@ -420,8 +420,8 @@ has returned.
         argument, if it names, relative to \t{D} a file which exists, then \t{sed} is run with the
         current expression on that file. Otherwise, the current expression is set to the text of the
         argument. The initial value of the expression is \t{s:\$\{D\}::g}. In EAPIs listed in
-        table~\ref{banned-commands-table}, this command is banned as per
-        section~\ref{banned-commands}.
+        table~\ref{tab:banned-commands-table}, this command is banned as per
+        section~\ref{sec:banned-commands}.
 }{
     \item[dosed] Takes any number of arguments, which can be files or \t{sed} expressions. For each
         argument, if it names, relative to \t{D} a file which exists, then \t{sed} is run with the
@@ -458,11 +458,11 @@ has returned.
     It is up to the ebuild to ensure that the relevant external utilities are available, whether by
     being in the system set or via dependencies.
 
-\item[inherit] See section~\ref{inherit}.
+\item[inherit] See section~\ref{sec:inherit}.
 
-\item[default] Calls the \t{default\_} function for the current phase (see section~\ref{default-phase-functions}).
+\item[default] Calls the \t{default\_} function for the current phase (see section~\ref{sec:default-phase-functions}).
     Must not be called if the \t{default\_} function does not exist for the current phase in the current EAPI.
-    Only available in EAPIs listed in table~\ref{default-phase-function-table}.
+    Only available in EAPIs listed in table~\ref{tab:default-phase-function-table}.
 \end{description}
 
 \subsubsection{Debug Commands}
diff --git a/profile-variables.tex b/profile-variables.tex
index 4381dcf..f720dd1 100644
--- a/profile-variables.tex
+++ b/profile-variables.tex
@@ -1,5 +1,5 @@
 \section{Profile variables}
-\label{profile-variables}
+\label{sec:profile-variables}
 
 This section documents variables that have special meaning, or special behaviour, when defined in a
 profile's \t{make.defaults} file.
@@ -29,11 +29,11 @@ completely override those in parent profiles.
 The following variables have specific meanings when set in profiles.
 \begin{description}
 \item[ARCH] The system's architecture. Must be a value listed in
-  \t{profiles/arch.list}; see section~\ref{arch.list}
+  \t{profiles/arch.list}; see section~\ref{sec:arch.list}
   for more information. Must be equal to the primary \t{KEYWORD} for this
   profile.
 \item[CONFIG\_PROTECT, CONFIG\_PROTECT\_MASK] Contain whitespace-delimited lists used to control the
-    configuration file protection. Described more fully in chapter~\ref{config-protect}.
+    configuration file protection. Described more fully in chapter~\ref{sec:config-protect}.
 \item[USE] Defines the list of default USE flags for this profile. Flags may be added or removed by
     the user's configuration. \t{USE\_EXPAND} values must not be specified in this way.
 \item[USE\_EXPAND] \label{use-expand} Defines a list of variables which are to be treated
diff --git a/profiles.tex b/profiles.tex
index 83fbfda..9dfbb1d 100644
--- a/profiles.tex
+++ b/profiles.tex
@@ -1,5 +1,5 @@
 \chapter{Profiles}
-\label{profiles}
+\label{sec:profiles}
 
 \section{General principles}
 Generally, a profile defines information specific to a certain `type' of system---it lies somewhere
@@ -28,7 +28,7 @@ encountering a cycle is undefined.
 This file must not contain comments, blank lines or make use of line continuations.
 
 \subsection{The eapi file}
-\label{profile-eapi}
+\label{sec:profile-eapi}
 A profile directory may contain an \t{eapi} 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
@@ -47,7 +47,7 @@ This file must not contain comments or make use of line continuations.
 \subsection{make.defaults}
 \t{make.defaults} is used to define defaults for various environment and configuration variables.
 This file is unusual in that it is not combined at a file level with the parent---instead, each
-variable is combined or overridden individually as described in section~\ref{profile-variables}.
+variable is combined or overridden individually as described in section~\ref{sec:profile-variables}.
 
 The file itself is a line-based key-value format. Each line contains a single \verb|VAR="value"|
 entry, where the value must be double quoted. A variable name must start with one of \t{a-zA-Z}
@@ -63,7 +63,7 @@ bash syntax, is allowed as follows:
 \end{compactitem}
 
 \subsection{virtuals}
-\label{profiles-virtuals}
+\label{sec:profiles-virtuals}
 The \t{virtuals} file defines default providers for ``old-style'' virtual packages. It is a simple
 line-based file, with each line containing two whitespace-delimited tokens. The first is a virtual
 package name (for example, \t{virtual/alsa}) and the second is a qualified package name. Blank lines
@@ -82,7 +82,7 @@ current package manager. It is mentioned here for completeness only, and its for
 discussed.
 
 \subsection{Simple line-based files}
-\label{line-stacking}
+\label{sec:line-stacking}
 These files are a simple one-item-per-line list, which is inherited in the following manner: the
 parent profile's list is taken, and the current profile's list appended. If any line begins with a
 hyphen, then any lines previous to it whose contents are equal to the remainder of that line are
@@ -106,7 +106,7 @@ contains one package dependency specification; anything matching this specificat
 installed unless unmasked by the user's configuration.
 
 Note that the \t{-spec} syntax can be used to remove a mask in a parent profile, but not
-necessarily a global mask (from \t{profiles/package.mask}, section~\ref{profiles-package.mask}).
+necessarily a global mask (from \t{profiles/package.mask}, section~\ref{sec:profiles-package.mask}).
 
 \note Portage currently treats \t{profiles/package.mask} as being on the leftmost branch of the
     inherit tree when it comes to \t{-lines}. This behaviour may not be relied upon.
@@ -125,7 +125,7 @@ that the package should have the USE flag disabled.  The package dependency spec
 the forms defined by the directory's EAPI.
 
 \subsection{USE masking and forcing}
-\label{use-masking}
+\label{sec:use-masking}
 This section covers the four files \t{use.mask}, \t{use.force}, \t{package.use.mask} and
 \t{package.use.force}. They are described together because they interact in a non-trivial manner.
 
diff --git a/tree-layout.tex b/tree-layout.tex
index dc860d6..46e0d58 100644
--- a/tree-layout.tex
+++ b/tree-layout.tex
@@ -10,11 +10,11 @@ differently from normal.
 An ebuild repository shall occupy one directory on disk, with the following subdirectories:
 \begin{compactitem}
 \item One directory per category, whose name shall be the name of the category. The layout of
-    these directories shall be as described in section~\ref{category-dirs}.
-\item A \t{profiles} directory, described in section~\ref{profiles-dir}.
-\item A \t{licenses} directory (optional), described in section~\ref{licenses-dir}.
-\item An \t{eclass} directory (optional), described in section~\ref{eclass-dir}.
-\item A \t{metadata} directory (optional), described in section~\ref{metadata-dir}.
+    these directories shall be as described in section~\ref{sec:category-dirs}.
+\item A \t{profiles} directory, described in section~\ref{sec:profiles-dir}.
+\item A \t{licenses} directory (optional), described in section~\ref{sec:licenses-dir}.
+\item An \t{eclass} directory (optional), described in section~\ref{sec:eclass-dir}.
+\item A \t{metadata} directory (optional), described in section~\ref{sec:metadata-dir}.
 \item 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.
@@ -22,16 +22,16 @@ An ebuild repository shall occupy one directory on disk, with the following subd
 \end{compactitem}
 
 \section{Category Directories}
-\label{category-dirs}
+\label{sec:category-dirs}
 
 Each category provided by the repository (see also: the
-\t{profiles/categories} file, section~\ref{profiles-categories}) shall
+\t{profiles/categories} file, section~\ref{sec:profiles-categories}) shall
 be contained in one directory, whose name shall be that of the
 category. Each category directory shall contain:
 \begin{compactitem}
-\item A \t{metadata.xml} file, as described in appendix~\ref{metadata-xml}\@. Optional.
+\item A \t{metadata.xml} file, as described in appendix~\ref{sec:metadata-xml}\@. Optional.
 \item Zero or more package directories, one for each package in the
-  category, as described in section~\ref{package-dirs}. The name of
+  category, as described in section~\ref{sec:package-dirs}. The name of
   the package directory shall be the corresponding package name.
 \end{compactitem}
 
@@ -45,12 +45,12 @@ directory that does not exist shall be considered equivalent to an empty categor
 a package manager may treat an empty category as a category that does not exist).
 
 \section{Package Directories}
-\label{package-dirs}
+\label{sec:package-dirs}
 
 A package directory contains the following:
 \begin{compactitem}
-\item Zero or more ebuilds. These are as described in section~\ref{ebuild-format} and others.
-\item A \t{metadata.xml} file, as described in appendix~\ref{metadata-xml}\@. Optional only for
+\item Zero or more ebuilds. These are as described in section~\ref{sec:ebuild-format} and others.
+\item A \t{metadata.xml} file, as described in appendix~\ref{sec:metadata-xml}\@. Optional only for
     legacy support.
 \item A \t{ChangeLog}, in a format determined by the provider of the respository. Optional.
 \item A \t{Manifest} file, whose format is described in \cite{Glep44}.
@@ -81,10 +81,10 @@ A package directory may contain other files or directories, whose purpose is not
 this specification.
 
 \section{The Profiles Directory}
-\label{profiles-dir}
+\label{sec:profiles-dir}
 
 The profiles directory shall contain zero or more profile directories
-as described in section~\ref{profiles}, as well as the following files
+as described in section~\ref{sec:profiles}, as well as the following files
 and directories. In any line-based file, lines beginning with a \#
 character are treated as comments, whilst blank lines are ignored. All
 contents of this directory, with the exception of \t{repo\_name}, are
@@ -117,26 +117,26 @@ manager must ignore any files in this directory that it does not recognise.
     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.
-\item[profiles.desc] Described below in section~\ref{profiles.desc}.
+\item[profiles.desc] Described below in section~\ref{sec:profiles.desc}.
 \item[repo\_name] Contains, on a single line, the name of this repository. The repository name must
-    conform to section~\ref{repository-names}.
-\item[thirdpartymirrors] Described below in section~\ref{thirdpartymirrors}.
+    conform to section~\ref{sec:repository-names}.
+\item[thirdpartymirrors] Described below in section~\ref{sec:thirdpartymirrors}.
 \item[use.desc] Contains descriptions of valid global USE flags for this repository. The format is
-    described in section~\ref{use.desc}.
+    described in section~\ref{sec:use.desc}.
 \item[use.local.desc] 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~\ref{use.desc}.
+    the packages to which they apply. The format is as described in section~\ref{sec:use.desc}.
 \item[desc/] This directory contains files analogous to \t{use.desc} for the various \t{USE\_EXPAND}
     variables. Each file in it is named \t{<varname>.desc}, where \t{<varname>} is the variable
     name, in lowercase, whose possible values the file describes. The format of each file is as for
-    \t{use.desc}, described in section~\ref{use.desc}. The \t{USE\_EXPAND} name is \i{not}
+    \t{use.desc}, described in section~\ref{sec:use.desc}. The \t{USE\_EXPAND} name is \i{not}
     included as a prefix here.
-\item[updates/] This directory is described in section~\ref{updates-dir}.
+\item[updates/] This directory is described in section~\ref{sec:updates-dir}.
 \end{description}
 
 \subsection{The profiles.desc file}
-\label{profiles.desc}
+\label{sec:profiles.desc}
 \t{profiles.desc} is a line-based file, with the standard commenting
-rules from section~\ref{profiles-dir}, containing a list of profiles
+rules from section~\ref{sec:profiles-dir}, containing a list of profiles
 that are valid for use, along with their associated architecture and
 status. Each line has the format:
 
@@ -159,7 +159,7 @@ Where:
 Fields are whitespace-delimited.
 
 \subsection{The thirdpartymirrors file}
-\label{thirdpartymirrors}
+\label{sec:thirdpartymirrors}
 \t{thirdpartymirrors} is another simple line-based file, describing the valid mirrors for use with
 \t{mirror://} URIs in this repository, and the associated download locations. The format of each
 line is:
@@ -180,7 +180,7 @@ The mirror with the name equal to the repository's name (and if the repository h
 the master's name) may be consulted for all downloads.
 
 \subsection{use.desc and related files}
-\label{use.desc}
+\label{sec:use.desc}
 \t{use.desc} 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:
 \begin{verbatim}
@@ -197,7 +197,7 @@ Flags must be listed once for each package to which they apply, or if a flag is
 differs from that described in \t{use.desc}.
 
 \subsection{The updates directory}
-\label{updates-dir}
+\label{sec:updates-dir}
 The \t{updates} directory is used to inform the package manager that a package has moved categories,
 names, or that a version has changed SLOT. It contains one file per quarter year, named
 \t{[1-4]Q-[YYYY]} for the first to fourth quarter of a given year, for example \t{1Q-2004} or
@@ -219,22 +219,22 @@ that has appeared as the origin of a slot move may not be used by packages match
 that slot move in the future.
 
 \section{The Licenses Directory}
-\label{licenses-dir}
+\label{sec:licenses-dir}
 
 The \t{licenses} 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 \t{LICENSE} variable as
-described in section~\ref{ebuild-var-LICENSE}, and will contain the complete text of the license in
+described in section~\ref{sec:ebuild-var-LICENSE}, and will contain the complete text of the license in
 human-readable form. Plain text format is strongly preferred but not required.
 
 \section{The Eclass Directory}
-\label{eclass-dir}
+\label{sec:eclass-dir}
 
 The \t{eclass} directory shall contain copies of the eclasses provided by this repository. The
-format of these files is described in section~\ref{eclasses}. It may also contain, in their own
+format of these files is described in section~\ref{sec:eclasses}. It may also contain, in their own
 directory, support files needed by these eclasses.
 
 \section{The Metadata Directory}
-\label{metadata-dir}
+\label{sec:metadata-dir}
 
 The \t{metadata} directory contains various repository-level metadata that is not contained in
 \t{profiles/}. All contents are optional. In this standard only the \t{cache} subdirectory is
diff --git a/virtuals.tex b/virtuals.tex
index 7f40756..fb5d994 100644
--- a/virtuals.tex
+++ b/virtuals.tex
@@ -1,13 +1,13 @@
 \chapter{Old-Style Virtual Packages}
-\label{old-virtuals}
+\label{sec:old-virtuals}
 
 Old-style virtuals are pseudo-packages---they can be depended upon or
 installed, but do not exist in the ebuild repository.  An old-style
 virtual requires several things in the repository: at least one ebuild
 must list the virtual in its \t{PROVIDE} variable, and there must be
 at least one entry in a profiles \t{virtuals} file listing the default
-provider for each profile---see sections~\ref{ebuild-var-provide} and
-\ref{profiles-virtuals} for specifics on these two. Old-style virtuals
+provider for each profile---see sections~\ref{sec:ebuild-var-provide} and
+\ref{sec:profiles-virtuals} for specifics on these two. Old-style virtuals
 require special handling as regards dependencies; this is described
 below.
 
@@ -24,15 +24,15 @@ When a dependency on a virtual package is encountered, it must be
 resolved into a real package before it can be satisfied. There are two
 factors that affect this process: whether a package providing the
 virtual is installed, and the \t{virtuals} file in the active profile
-(section~\ref{profiles-virtuals}). If a package is already installed
+(section~\ref{sec:profiles-virtuals}). If a package is already installed
 which satisfies the virtual requirement (via \t{PROVIDE}), then it
 should be used to satisfy the dependency. Otherwise, the profiles
-\t{virtuals} file (section~\ref{profiles-virtuals}) should be
+\t{virtuals} file (section~\ref{sec:profiles-virtuals}) should be
 consulted to choose an appropriate provider.
 
 Dependencies on old style virtuals must not use any kind of version restriction.
 
-Blocks on provided virtuals have special behaviour documented in section~\ref{provided-blocks}.
+Blocks on provided virtuals have special behaviour documented in section~\ref{sec:provided-blocks}.
 
 % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
 
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.12: pms-11.patch --]
[-- Type: text/x-patch, Size: 6375 bytes --]

From 54f80bcda667f344ef3027cade8b637ccf144863 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:30:46 +0100
Subject: [PATCH] Use date from VC system

Make the \date command aware of the version control system by adding
the vc package (public-domain) and thus display date of last commit
and not of generation.
---
 Makefile   |    1 +
 pms.tex    |    3 ++
 vc         |   24 ++++++++++++++++
 vc-git.awk |   89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 117 insertions(+), 0 deletions(-)
 create mode 100644 vc
 create mode 100644 vc-git.awk

diff --git a/Makefile b/Makefile
index 774fc39..7fd8c9a 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@ pms.html: $(SOURCEFILES) pms.bbl
 	sed -i -e '/<span class="ALCitem">/{N;s/\n\(class="[^"]\+">\)\([0-9]:\)<\/span>/\1\&#x2007;\2/}' pms.html
 
 pms.bbl: pms.bib pms.tex
+	/bin/sh ./vc
 	latex pms
 	bibtex pms
 
diff --git a/pms.tex b/pms.tex
index 99f5fa8..84b88b2 100644
--- a/pms.tex
+++ b/pms.tex
@@ -1,4 +1,5 @@
 \documentclass[a4paper]{report}
+\input{vc}
 % Definition of fonts, choose T1 encoding for fonts
 \usepackage[T1]{fontenc}
 %
@@ -19,6 +20,7 @@
   algorithm,
   algorithmic
 }
+\usepackage[english]{isodate}
 \usepackage[DIV13]{typearea}
 \usepackage[position=top]{caption}
 \usepackage[utf8]{inputenc}
@@ -107,6 +109,7 @@
 \title{Package Manager Specification}
 \author{Stephen P. Bennett\\\url{spb@exherbo.org}
 \and Ciaran McCreesh\\\url{ciaran.mccreesh@googlemail.com}}
+\date{\printdate{\VCDateISO}}
 \pagestyle{myheadings}
 \markboth{\scshape Package Manager Specification}{\scshape Package
   Manager Specification \chaptermark}
diff --git a/vc b/vc
new file mode 100644
index 0000000..5c5a1b3
--- /dev/null
+++ b/vc
@@ -0,0 +1,24 @@
+#!/bin/sh
+# This is file 'vc' from the vc bundle for TeX.
+# The original file can be found at CTAN:support/vc.
+# This file is Public Domain.
+
+# Parse command line options.
+full=0
+mod=0
+while [ -n "$(echo $1 | grep '-')" ]; do
+    case $1 in 
+       -f ) full=1 ;;
+       -m ) mod=1 ;;
+       *  ) echo 'usage: vc [-f] [-m]'
+            exit 1
+    esac
+    shift
+done
+# English locale.
+LC_ALL=C
+git --no-pager log -1 HEAD --pretty=format:"Hash: %H%nAbr. Hash: %h%nParent Hashes: %P%nAbr. Parent Hashes: %p%nAuthor Name: %an%nAuthor Email: %ae%nAuthor Date: %ai%nCommitter Name: %cn%nCommitter Email: %ce%nCommitter Date: %ci%n" |gawk -v script=log -v full=$full -f vc-git.awk > vc.tex
+if [ "$mod" = 1 ]
+then
+  git status |gawk -v script=status -f vc-git.awk >> vc.tex
+fi
diff --git a/vc-git.awk b/vc-git.awk
new file mode 100644
index 0000000..66b3526
--- /dev/null
+++ b/vc-git.awk
@@ -0,0 +1,89 @@
+# This is file 'vc-git.awk' from the vc bundle for TeX.
+# The original file can be found at CTAN:support/vc.
+# This file is Public Domain.
+BEGIN {
+		
+### Process output of "git status".
+		if (script=="status") {
+				modified = 0
+		}
+
+}
+
+
+
+### Process output of "git log".
+script=="log" && /^Hash:/ { Hash = substr($0, 2+match($0, ":")) }
+script=="log" && /^Abr. Hash:/ { AbrHash = substr($0, 2+match($0, ":")) }
+script=="log" && /^Parent Hashes:/ { ParentHashes = substr($0, 2+match($0, ":")) }
+script=="log" && /^Abr. Parent Hashes:/ { AbrParentHashes = substr($0, 2+match($0, ":")) }
+script=="log" && /^Author Name:/ { AuthorName = substr($0, 2+match($0, ":")) }
+script=="log" && /^Author Email:/ { AuthorEmail = substr($0, 2+match($0, ":")) }
+script=="log" && /^Author Date:/ { AuthorDate = substr($0, 2+match($0, ":")) }
+script=="log" && /^Committer Name:/ { CommitterName = substr($0, 2+match($0, ":")) }
+script=="log" && /^Committer Email:/ { CommitterEmail = substr($0, 2+match($0, ":")) }
+script=="log" && /^Committer Date:/ { CommitterDate = substr($0, 2+match($0, ":")) }
+
+### Process output of "git status".
+### Changed index?
+script=="status" && /^# Changes to be committed:/ { modified = 1 }
+### Unstaged modifications?
+script=="status" && /^# Changed but not updated:/ { modified = 2 }
+
+
+
+END {
+		
+### Process output of "git log".
+		if (script=="log") {
+### Standard encoding is UTF-8.
+				if (Encoding == "") Encoding = "UTF-8"
+### Extract relevant information from variables.
+				LongDate = substr(AuthorDate, 1, 25)
+        DateRAW = substr(LongDate, 1, 10)
+        DateISO = DateRAW
+        DateTEX = DateISO
+        gsub("-", "/", DateTEX)
+				Time = substr(LongDate, 12, 14)
+### Write file identification to vc.tex.
+				print "%%% This file has been generated by the vc bundle for TeX."
+				print "%%% Do not edit this file!"
+				print "%%%"
+### Write Git specific macros.
+				print "%%% Define Git specific macros."
+				print "\\gdef\\GITHash{" Hash "}%"
+				print "\\gdef\\GITAbrHash{" AbrHash "}%"
+				print "\\gdef\\GITParentHashes{" ParentHashes "}%"
+				print "\\gdef\\GITAbrParentHashes{" AbrParentHashes "}%"
+				print "\\gdef\\GITAuthorName{" AuthorName "}%"
+				print "\\gdef\\GITAuthorEmail{" AuthorEmail "}%"
+				print "\\gdef\\GITAuthorDate{" AuthorDate "}%"
+				print "\\gdef\\GITCommitterName{" CommitterName "}%"
+				print "\\gdef\\GITCommitterEmail{" CommitterEmail "}%"
+				print "\\gdef\\GITCommitterDate{" CommitterDate "}%"
+### Write generic version control macros.
+				print "%%% Define generic version control macros."
+				print "\\gdef\\VCRevision{\\GITAbrHash}%"
+				print "\\gdef\\VCAuthor{\\GITAuthorName}%"
+        print "\\gdef\\VCDateRAW{" DateRAW "}%"
+        print "\\gdef\\VCDateISO{" DateISO "}%"
+        print "\\gdef\\VCDateTEX{" DateTEX "}%"
+				print "\\gdef\\VCTime{" Time "}%"
+				print "\\gdef\\VCModifiedText{\\textcolor{red}{with local modifications!}}%"
+				print "%%% Assume clean working copy."
+				print "\\gdef\\VCModified{0}%"
+				print "\\gdef\\VCRevisionMod{\\VCRevision}%"
+		}
+		
+### Process output of "git status".
+		if (script=="status") {
+				print "%%% Is working copy modified?"
+				print "\\gdef\\VCModified{" modified "}%"
+				if (modified==0) {
+						print "\\gdef\\VCRevisionMod{\\VCRevision}%"
+				} else {
+						print "\\gdef\\VCRevisionMod{\\VCRevision~\\VCModifiedText}%"
+				}
+		}
+		
+}
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.13: pms-12.patch --]
[-- Type: text/x-patch, Size: 680 bytes --]

From 7318f82d52a093a4d68c571947b5d4ca3ab9dd9a Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:32:12 +0100
Subject: [PATCH] remove spurious \chaptermark command, introduced by me by failure

---
 pms.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pms.tex b/pms.tex
index 84b88b2..e25e09f 100644
--- a/pms.tex
+++ b/pms.tex
@@ -112,7 +112,7 @@
 \date{\printdate{\VCDateISO}}
 \pagestyle{myheadings}
 \markboth{\scshape Package Manager Specification}{\scshape Package
-  Manager Specification \chaptermark}
+  Manager Specification}
 
 \begin{document}
 \maketitle
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.14: pms-13.patch --]
[-- Type: text/x-patch, Size: 1290 bytes --]

From 8c85e1eb5aa315e9f186da24728f471833b82cc6 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:32:51 +0100
Subject: [PATCH] Fix broken references

---
 eapi-differences.tex |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/eapi-differences.tex b/eapi-differences.tex
index e1d44fb..37b1c2b 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -44,7 +44,7 @@
 
 \IFANYKDEBUILDELSE{
     \IFKDEBUILDCOLOUR{File extension} &
-    \IFKDEBUILDCOLOUR{section~\ref{sec:file-extension}} &
+    \IFKDEBUILDCOLOUR{section~\ref{file-extension}} &
     \IFKDEBUILDCOLOUR{\t{.ebuild}} &
     \IFKDEBUILDCOLOUR{\t{.ebuild}} &
     \IFKDEBUILDCOLOUR{\t{.kdebuild-1}} &
@@ -217,7 +217,7 @@ EAPI 1 is EAPI 0 with the following changes:
 
     \begin{compactitem}
     \item \t{scm} support, table~\ref{tab:scm-table}.
-    \item \t{kdebuild-1} file extension, section~\ref{tab:file-extension}.
+    \item \t{kdebuild-1} file extension, section~\ref{file-extension}.
     \item \t{PROVIDE} banned, table~\ref{tab:provide-table}.
     \item Pre-source EAPI is \t{kdebuild-1}, section~\ref{sec:pre-source-eapi}.
     \item \t{SRC\_URI} arrows, table~\ref{tab:uri-arrows-table}.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.15: pms-14.patch --]
[-- Type: text/x-patch, Size: 791 bytes --]

From 0e9343705021da67a9aa9bb06ecfff405fbae2b4 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:33:40 +0100
Subject: [PATCH] Fix broken reference

---
 names.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/names.tex b/names.tex
index 0d48b09..5c6d4fe 100644
--- a/names.tex
+++ b/names.tex
@@ -27,7 +27,7 @@ hyphen or a dot.
 \subsection{USE Flag Names}
 A USE flag name may contain any of the characters [\t{A-Za-z0-9+\_@-}]. It must begin with an
 alphanumeric character. Underscores should be considered reserved for \t{USE\_EXPAND}, as
-described in section~\ref{sec:use-expand}.
+described in section~\ref{use-expand}.
 
 \note The at-sign is required for \t{LINGUAS}.
 
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.16: pms-15.patch --]
[-- Type: text/x-patch, Size: 903 bytes --]

From b7b56d8eea025368fc20f1fc28ccf4f7bdc7bc54 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:34:08 +0100
Subject: [PATCH] Fix broken reference

---
 tree-layout.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tree-layout.tex b/tree-layout.tex
index 46e0d58..1891342 100644
--- a/tree-layout.tex
+++ b/tree-layout.tex
@@ -25,7 +25,7 @@ An ebuild repository shall occupy one directory on disk, with the following subd
 \label{sec:category-dirs}
 
 Each category provided by the repository (see also: the
-\t{profiles/categories} file, section~\ref{sec:profiles-categories}) shall
+\t{profiles/categories} file, section~\ref{profiles-categories}) shall
 be contained in one directory, whose name shall be that of the
 category. Each category directory shall contain:
 \begin{compactitem}
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.17: pms-16.patch --]
[-- Type: text/x-patch, Size: 1054 bytes --]

From b7feb87013c1b01914855f9b0499b00e1e885c54 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:37:20 +0100
Subject: [PATCH] Fix broken reference

---
 profiles.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/profiles.tex b/profiles.tex
index 9dfbb1d..4af3304 100644
--- a/profiles.tex
+++ b/profiles.tex
@@ -106,7 +106,7 @@ contains one package dependency specification; anything matching this specificat
 installed unless unmasked by the user's configuration.
 
 Note that the \t{-spec} syntax can be used to remove a mask in a parent profile, but not
-necessarily a global mask (from \t{profiles/package.mask}, section~\ref{sec:profiles-package.mask}).
+necessarily a global mask (from \t{profiles/package.mask}, section~\ref{profiles-package.mask}).
 
 \note Portage currently treats \t{profiles/package.mask} as being on the leftmost branch of the
     inherit tree when it comes to \t{-lines}. This behaviour may not be relied upon.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.18: pms-17.patch --]
[-- Type: text/x-patch, Size: 989 bytes --]

From 27714af73f83ff1392a9fd16eb2224b74dee465e Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:37:45 +0100
Subject: [PATCH] Fix broken reference

---
 profile-variables.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/profile-variables.tex b/profile-variables.tex
index f720dd1..cebcd68 100644
--- a/profile-variables.tex
+++ b/profile-variables.tex
@@ -29,7 +29,7 @@ completely override those in parent profiles.
 The following variables have specific meanings when set in profiles.
 \begin{description}
 \item[ARCH] The system's architecture. Must be a value listed in
-  \t{profiles/arch.list}; see section~\ref{sec:arch.list}
+  \t{profiles/arch.list}; see section~\ref{arch.list}
   for more information. Must be equal to the primary \t{KEYWORD} for this
   profile.
 \item[CONFIG\_PROTECT, CONFIG\_PROTECT\_MASK] Contain whitespace-delimited lists used to control the
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.19: pms-18.patch --]
[-- Type: text/x-patch, Size: 889 bytes --]

From 199a0fffba4ad53457335504922b9cb8771f30dd Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:39:39 +0100
Subject: [PATCH] Fix broken label

---
 dependencies.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dependencies.tex b/dependencies.tex
index 5d37e6f..7d9bc75 100644
--- a/dependencies.tex
+++ b/dependencies.tex
@@ -313,7 +313,7 @@ manager, so long as any blocked package will be uninstalled later on. A strong b
 ignored. The mapping from one or two exclamation marks to strength is described in
 table~\ref{tab:bang-strength-table}.
 
-\begin{centertable}{Exclamation mark strengths for EAPIs} \label{bang-strength-table}
+\begin{centertable}{Exclamation mark strengths for EAPIs} \label{tab:bang-strength-table}
 \IFKDEBUILDELSE
 {
     \begin{tabular}{ l l l }
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.20: pms-19.patch --]
[-- Type: text/x-patch, Size: 1246 bytes --]

From 0e278fe2d75d3e43566241ab86b6b9ab2fb132bb Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:40:21 +0100
Subject: [PATCH] Fix broken reference

---
 ebuild-functions.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ebuild-functions.tex b/ebuild-functions.tex
index 96b202e..966ed94 100644
--- a/ebuild-functions.tex
+++ b/ebuild-functions.tex
@@ -8,7 +8,7 @@ The following is a list of functions that an ebuild, or eclass, may define, and
 by the package manager as part of the build and/or install process. In all cases the package manager
 must provide a default implementation of these functions; unless otherwise stated this must be a
 no-op. Most functions must assume only that they have write access to the package's working
-directory (the \t{WORKDIR} environment variable; see section~\ref{sec:env-var-WORKDIR}), and the
+directory (the \t{WORKDIR} environment variable; see section~\ref{env-var-WORKDIR}), and the
 temporary directory \t{T}; exceptions are noted below. All functions may assume that they have read
 access to all system libraries, binaries and configuration files that are accessible to normal
 users.
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.21: pms-20.patch --]
[-- Type: text/x-patch, Size: 700 bytes --]

From b0ff7914a70a2a0944e6cdca5c2c88d5330b997d Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:41:37 +0100
Subject: [PATCH] Fix broken reference

---
 appendices.tex |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/appendices.tex b/appendices.tex
index 8a224d4..fef856b 100644
--- a/appendices.tex
+++ b/appendices.tex
@@ -54,7 +54,7 @@ it must not be used.
 
 \IFKDEBUILDELSE
 {
-    The \t{scm} version rules specified in section~\ref{sec:scm-versions} solve all of these issues.
+    The \t{scm} version rules specified in section~\ref{scm-versions} solve all of these issues.
 }{
 }
 
-- 
1.6.0.6


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.22: pms-21.patch --]
[-- Type: text/x-patch, Size: 1402 bytes --]

From b6bcbc8e917bc85ce34d393aba3b82ea2a543813 Mon Sep 17 00:00:00 2001
From: Christian Faulhammer <fauli@gentoo.org>
Date: Wed, 18 Feb 2009 09:43:01 +0100
Subject: [PATCH] Fix broken references

---
 eapi-differences.tex |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/eapi-differences.tex b/eapi-differences.tex
index 37b1c2b..7c142f4 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -186,7 +186,7 @@ Use dependencies & table~\ref{tab:use-deps-table} & No & No &
     \IFKDEBUILDCOLOUR{Yes} \\
 }{}
 
-\t{default} function & table~\ref{tab:default-function-table} & No & No &
+\t{default} function & table~\ref{tab:default-phase-function-table} & No & No &
     \IFANYKDEBUILDELSE{\IFKDEBUILDCOLOUR{No} &}{} Yes \\
 
 \end{longtable}
@@ -247,7 +247,7 @@ EAPI 2 is EAPI 1 with the following changes:
 \item \t{default\_} phase functions for phases \t{pkg\_nofetch}, \t{src\_unpack}, \t{src\_prepare},
     \t{src\_configure}, \t{src\_compile} and \t{src\_test}; table~\ref{tab:default-phase-function-table}.
 \item \t{doman} languages support, table~\ref{tab:doman-table}.
-\item \t{default} function, table~\ref{tab:default-function-table}.
+\item \t{default} function, table~\ref{tab:default-phase-function-table}.
 \end{compactitem}
 
 % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
-- 
1.6.0.6


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [gentoo-pms] Some improvements
  2009-02-18 16:53 [gentoo-pms] Some improvements Christian Faulhammer
@ 2009-02-18 18:54 ` David Leverton
  2009-02-19  9:27   ` Christian Faulhammer
  2009-02-18 19:15 ` Ciaran McCreesh
  1 sibling, 1 reply; 4+ messages in thread
From: David Leverton @ 2009-02-18 18:54 UTC (permalink / raw
  To: gentoo-pms

On Wednesday 18 February 2009 16:53:43 Christian Faulhammer wrote:
> Hi,
>
> another round for my patch burst.  Comment, apply or die.

You might want to read up on "git commit --amend" and "git 
rebase --interactive" ;-)

> punt table default-function-table, as the contents corresponds with
> default-phase-function-table
> Patches 08 and 21

These are technically separate concepts - there could conceivable be an EAPI 
that has default_ functions but not default itself.  On the other hand, it's 
not really a big deal, and easy to reverse this change if necessary (probably 
quite unlikely anyway).

> Generate date on titlepage from last commit
> Patch 11

This fails if it's not built from a git working tree, as happens with 
git.eclass and pms-99999999.ebuild, and also any snapshot that anyone may or 
may not want to distribute in future.

Everything else seems OK to me.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-pms] Some improvements
  2009-02-18 16:53 [gentoo-pms] Some improvements Christian Faulhammer
  2009-02-18 18:54 ` David Leverton
@ 2009-02-18 19:15 ` Ciaran McCreesh
  1 sibling, 0 replies; 4+ messages in thread
From: Ciaran McCreesh @ 2009-02-18 19:15 UTC (permalink / raw
  To: gentoo-pms

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

On Wed, 18 Feb 2009 17:53:43 +0100
Christian Faulhammer <fauli@gentoo.org> wrote:
> Visual appearance of variables or options (minor changes)
> Patches 01--07

Could you squash all of these into fewer patches (probably one) please?

> punt table default-function-table, as the contents corresponds with
> default-phase-function-table
> Patches 08 and 21

Again, squash please.

> Page header, looks nicer in my eyes (and one bug fix introduced by my
> patch)
> Patches 09 and 12

And these.

> Fix all of the above
> Patches 13--20

And merge these into the relevant patches above.

It's easier if we keep our history nice and clean. Possibly not such a
big deal for non-code, but breaking then fixing things breaks bisect
and makes it harder to try out arbitrary revisions.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-pms] Some improvements
  2009-02-18 18:54 ` David Leverton
@ 2009-02-19  9:27   ` Christian Faulhammer
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Faulhammer @ 2009-02-19  9:27 UTC (permalink / raw
  To: David Leverton; +Cc: gentoo-pms

[-- Attachment #1: Type: text/plain, Size: 1449 bytes --]

Hi,

David Leverton <levertond@googlemail.com>:

> On Wednesday 18 February 2009 16:53:43 Christian Faulhammer wrote:
> > Hi,
> >
> > another round for my patch burst.  Comment, apply or die.
> 
> You might want to read up on "git commit --amend" and "git 
> rebase --interactive" ;-)

 Grrr, I hate Git. :)  I will.

> > punt table default-function-table, as the contents corresponds with
> > default-phase-function-table
> > Patches 08 and 21
> 
> These are technically separate concepts - there could conceivable be
> an EAPI that has default_ functions but not default itself.  On the
> other hand, it's not really a big deal, and easy to reverse this
> change if necessary (probably quite unlikely anyway).

 It is a current snapshot, so at the moment we have doubled information
where not necessary.

> > Generate date on titlepage from last commit
> > Patch 11
> 
> This fails if it's not built from a git working tree, as happens with 
> git.eclass and pms-99999999.ebuild, and also any snapshot that anyone
> may or may not want to distribute in future.

 A check for an empty \VCDateISO could be made and set it to \today (or
whatever).  Anyway, having the same date on the same (content-wise)
PMS, generated on different machines is nice.

V-Li

-- 
Christian Faulhammer, Gentoo Lisp project
<URL:http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode

<URL:http://www.faulhammer.org/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-19  9:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-18 16:53 [gentoo-pms] Some improvements Christian Faulhammer
2009-02-18 18:54 ` David Leverton
2009-02-19  9:27   ` Christian Faulhammer
2009-02-18 19:15 ` Ciaran McCreesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox