Gentoo Archives: gentoo-pms

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

Replies

Subject Author
[gentoo-pms] [PATCH 18/21 v2] EAPI 8 has dosym -r "Ulrich Müller" <ulm@g.o>