Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms:eapi-8 commit in: /
Date: Tue, 18 May 2021 05:44:43
Message-Id: 1621316655.49bf9d7d0e648eeb0bb5891e2c5805f0a7466c64.ulm@gentoo
1 commit: 49bf9d7d0e648eeb0bb5891e2c5805f0a7466c64
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 16 18:22:15 2021 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Tue May 18 05:44:15 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=49bf9d7d
7
8 EAPI 8 has dosym -r
9
10 Bug: https://bugs.gentoo.org/708360
11 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
12
13 eapi-differences.tex | 4 ++++
14 pkg-mgr-commands.tex | 38 +++++++++++++++++++++++++++++++++++---
15 2 files changed, 39 insertions(+), 3 deletions(-)
16
17 diff --git a/eapi-differences.tex b/eapi-differences.tex
18 index 1503053..1cf3ce9 100644
19 --- a/eapi-differences.tex
20 +++ b/eapi-differences.tex
21 @@ -290,6 +290,9 @@ Output commands use stdout & \compactfeatureref{output-no-stdout} &
22 \t{domo} destination path & \compactfeatureref{domo-path} &
23 \t{\$\{DESTTREE\}} & \t{\$\{DESTTREE\}} & \t{\$\{DESTTREE\}} & \t{/usr} & \t{/usr} \\
24
25 +\t{dosym -r} & \compactfeatureref{dosym-relative} &
26 + No & No & No & No & Yes \\
27 +
28 \t{new*} support stdin & \compactfeatureref{newfoo-stdin} &
29 No & Yes & Yes & Yes & Yes \\
30
31 @@ -513,6 +516,7 @@ EAPI 8 is EAPI 7 with the following changes:
32 \item \t{hasv} and \t{hasq} banned, \featureref{banned-commands}.
33 \item \t{econf} adds \t{-{}-datarootdir}, \featureref{econf-options}.
34 \item \t{econf} adds \t{-{}-disable-static}, \featureref{econf-options}.
35 +\item \t{dosym} can create relative paths, \featureref{dosym-relative}.
36 \end{compactitem}
37
38 \ChangeWhenAddingAnEAPI{8}
39
40 diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
41 index 46507b7..54ea342 100644
42 --- a/pkg-mgr-commands.tex
43 +++ b/pkg-mgr-commands.tex
44 @@ -612,9 +612,27 @@ the current phase function has returned.
45
46 \item[dosbin] As \t{dobin}, but installs to \t{DESTTREE/sbin}.
47
48 -\item[dosym] Creates a symbolic link named as for its second parameter, pointing to the first. If
49 - the directory containing the new link does not exist, creates it. Failure behaviour is EAPI
50 - dependent as per section~\ref{sec:failure-behaviour}.
51 +\item[dosym] Creates a symbolic link named as for its second parameter, pointing to the first.
52 + If the directory containing the new link does not exist, creates it.
53 +
54 + \featurelabel{dosym-relative} In EAPIs listed in table~\ref{tab:dosym-r} as supporting creation
55 + of relative paths, when called with option \t{-r}, expands the first parameter relative to
56 + the apparent path of the directory containing the first parameter. The algorithm must return
57 + a result identical to the one returned by the function in listing~\ref{lst:dosym-r},
58 + with \t{realpath} and \t{dirname} from GNU coreutils version~8.32. Specifying option \t{-r}
59 + together with a relative path as first (target) parameter is an error.
60 +
61 + Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
62 +
63 +\begin{listing}[h]
64 +\caption{Create a relative path for \t{dosym -r}} \label{lst:dosym-r}
65 +\begin{verbatim}
66 +dosym_relative_path() {
67 + local link=$(realpath -m -s "/${2#/}")
68 + realpath -m -s --relative-to="$(dirname "${link}")" "$1"
69 +}
70 +\end{verbatim}
71 +\end{listing}
72
73 \item[fowners] Acts as for \t{chown}, but takes paths relative to the image directory. Failure
74 behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
75 @@ -742,6 +760,20 @@ the current phase function has returned.
76 \end{tabular}
77 \end{centertable}
78
79 +\ChangeWhenAddingAnEAPI{8}
80 +\begin{centertable}{EAPIs supporting \t{dosym -r}}
81 + \label{tab:dosym-r}
82 + \begin{tabular}{ll}
83 + \toprule
84 + \multicolumn{1}{c}{\textbf{EAPI}} &
85 + \multicolumn{1}{c}{\textbf{\t{dosym} supports creation of relative paths?}} \\
86 + \midrule
87 + 0, 1, 2, 3, 4, 5, 6, 7 & No \\
88 + 8 & Yes \\
89 + \bottomrule
90 + \end{tabular}
91 +\end{centertable}
92 +
93 \subsection{Commands affecting install destinations}
94 The following commands are used to set the various destination trees and options used by the above
95 installation commands. They must be shell functions or aliases, due to the need to set variables