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: Wed, 26 May 2021 07:13:48
Message-Id: 1621973036.f0fb2d5886ed710a427720fdb4f380a46aa44bc0.ulm@gentoo
1 commit: f0fb2d5886ed710a427720fdb4f380a46aa44bc0
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 25 20:03:56 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=f0fb2d58
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 | 39 ++++++++++++++++++++++++++++++++++++---
15 2 files changed, 40 insertions(+), 3 deletions(-)
16
17 diff --git a/eapi-differences.tex b/eapi-differences.tex
18 index d50b593..aa06551 100644
19 --- a/eapi-differences.tex
20 +++ b/eapi-differences.tex
21 @@ -293,6 +293,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 @@ -517,6 +520,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 817b52b..dd286a6 100644
42 --- a/pkg-mgr-commands.tex
43 +++ b/pkg-mgr-commands.tex
44 @@ -599,9 +599,28 @@ 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 the
56 + directory part of the second parameter. The algorithm must return a result identical to the one
57 + returned by the function in listing~\ref{lst:dosym-r}, with \t{realpath} and \t{dirname} from
58 + GNU coreutils version~8.32. Specifying option \t{-r} together with a relative path as first
59 + (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 + local linkdir=$(dirname "${link}")
69 + realpath -m -s --relative-to="${linkdir}" "$1"
70 +}
71 +\end{verbatim}
72 +\end{listing}
73
74 \item[fowners] Acts as for \t{chown}, but takes paths relative to the image directory. Failure
75 behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
76 @@ -729,6 +748,20 @@ the current phase function has returned.
77 \end{tabular}
78 \end{centertable}
79
80 +\ChangeWhenAddingAnEAPI{8}
81 +\begin{centertable}{EAPIs supporting \t{dosym -r}}
82 + \label{tab:dosym-r}
83 + \begin{tabular}{ll}
84 + \toprule
85 + \multicolumn{1}{c}{\textbf{EAPI}} &
86 + \multicolumn{1}{c}{\textbf{\t{dosym} supports creation of relative paths?}} \\
87 + \midrule
88 + 0, 1, 2, 3, 4, 5, 6, 7 & No \\
89 + 8 & Yes \\
90 + \bottomrule
91 + \end{tabular}
92 +\end{centertable}
93 +
94 \subsection{Commands affecting install destinations}
95 The following commands are used to set the various destination trees and options used by the above
96 installation commands. They must be shell functions or aliases, due to the need to set variables