From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1283232-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 0B9351382C5
	for <garchives@archives.gentoo.org>; Mon, 17 May 2021 16:16:11 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 5AAD3E0825;
	Mon, 17 May 2021 16:16:10 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 428F6E0825
	for <gentoo-commits@lists.gentoo.org>; Mon, 17 May 2021 16:16:10 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id BF39E341011
	for <gentoo-commits@lists.gentoo.org>; Mon, 17 May 2021 16:16:08 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 70CD678E
	for <gentoo-commits@lists.gentoo.org>; Mon, 17 May 2021 16:16:07 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1621227267.a7575df63cb54fac8af5abc73e836c9762773602.ulm@gentoo>
Subject: [gentoo-commits] proj/pms:eapi-8 commit in: /
X-VCS-Repository: proj/pms
X-VCS-Files: eapi-differences.tex pkg-mgr-commands.tex
X-VCS-Directories: /
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: a7575df63cb54fac8af5abc73e836c9762773602
X-VCS-Branch: eapi-8
Date: Mon, 17 May 2021 16:16:07 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 51862102-42e9-4732-937e-baf7b352d4d0
X-Archives-Hash: 4e5aa4497779c83c7bd447ae8322ed9e

commit:     a7575df63cb54fac8af5abc73e836c9762773602
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun May 16 18:22:15 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon May 17 04:54:27 2021 +0000
URL:        https://gitweb.gentoo.org/proj/pms.git/commit/?id=a7575df6

EAPI 8 has dosym -r

Bug: https://bugs.gentoo.org/708360
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 eapi-differences.tex |  4 ++++
 pkg-mgr-commands.tex | 38 +++++++++++++++++++++++++++++++++++---
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/eapi-differences.tex b/eapi-differences.tex
index b0d3707..cc127a3 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -286,6 +286,9 @@ Output commands use stdout & \compactfeatureref{output-no-stdout} &
 \t{domo} destination path & \compactfeatureref{domo-path} &
     \t{\$\{DESTTREE\}} & \t{\$\{DESTTREE\}} & \t{\$\{DESTTREE\}} & \t{/usr} & \t{/usr} \\
 
+\t{dosym -r} \compactfeatureref{dosym-relative} &
+    No & No & No & No & Yes \\
+
 \t{new*} support stdin & \compactfeatureref{newfoo-stdin} &
     No & Yes & Yes & Yes & Yes \\
 
@@ -524,6 +527,7 @@ EAPI 8 is EAPI 7 with the following changes:
 \item \t{insopts} no longer affects \t{doconfd}, \t{doenvd} and \t{doheader}, \featureref{insopts}.
 \item \t{exeopts} no longer affects \t{doinitd}, \featureref{exeopts}.
 \item Less strict naming rules for files in \t{updates} directory, \featureref{updates-filenames}.
+\item \t{dosym} can create relative paths, \featureref{dosym-relative}.
 \end{compactitem}
 
 \ChangeWhenAddingAnEAPI{8}

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 171a341..8d5c903 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -599,9 +599,27 @@ the current phase function has returned.
 
 \item[dosbin] As \t{dobin}, but installs to \t{DESTTREE/sbin}.
 
-\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. Failure behaviour is EAPI
-    dependent as per section~\ref{sec:failure-behaviour}.
+\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.
+
+    \featurelabel{dosym-relative} When called with option \t{-r} in EAPIs listed in
+    table~\ref{tab:dosym-r} as supporting creation of relative paths, expands the first parameter
+    relative to the apparent path of the directory containing the first parameter. The algorithm
+    must return a result identical to the one returned by the function in listing~\ref{lst:dosym-r},
+    with \t{realpath} and \t{dirname} from GNU coreutils version~8.32. Specifying option \t{-r}
+    together with a relative path as first (target) parameter is an error.
+
+    Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
+
+\begin{listing}[h]
+\caption{Create a relative path for \t{dosym}} \label{lst:dosym-r}
+\begin{verbatim}
+dosym_relative_path() {
+    local link=$(realpath -m -s "/${2#/}")
+    realpath -m -s --relative-to="$(dirname "${link}")" "$1"
+}
+\end{verbatim}
+\end{listing}
 
 \item[fowners] Acts as for \t{chown}, but takes paths relative to the image directory. Failure
     behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}.
@@ -729,6 +747,20 @@ the current phase function has returned.
     \end{tabular}
 \end{centertable}
 
+\ChangeWhenAddingAnEAPI{8}
+\begin{centertable}{EAPIs supporting \t{dosym -r}}
+    \label{tab:dosym-r}
+    \begin{tabular}{ll}
+      \toprule
+      \multicolumn{1}{c}{\textbf{EAPI}} &
+      \multicolumn{1}{c}{\textbf{\t{dosym} supports creation of relative paths?}} \\
+      \midrule
+      0, 1, 2, 3, 4, 5, 6, 7  & No  \\
+      8                       & Yes \\
+      \bottomrule
+    \end{tabular}
+\end{centertable}
+
 \subsection{Commands affecting install destinations}
 The following commands are used to set the various destination trees and options used by the above
 installation commands. They must be shell functions or aliases, due to the need to set variables