commit:     57778b90ee0f252bb4b295f3b0053e9a581b85fb
Author:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  1 14:42:02 2016 +0000
Commit:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
CommitDate: Mon Jul  4 03:46:15 2016 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=57778b90

ebuild-writing/variables: update wrt ROOT always ending in a trailing slash

Per PMS[0], ROOT must end in a trailing slash. Remove the trailing
slash characters ('/') that appear after ${ROOT} in the example and
add a note about it.

There is a future EAPI request to remove this trailing slash
(#465722). Suggest the use of '${EROOT%/}' for maximum compatibility.

[0] https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-11900011.1

 ebuild-writing/variables/text.xml | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/ebuild-writing/variables/text.xml 
b/ebuild-writing/variables/text.xml
index 3f99cfb..7368525 100644
--- a/ebuild-writing/variables/text.xml
+++ b/ebuild-writing/variables/text.xml
@@ -431,16 +431,27 @@ old and obsolete configuration file still exists:
 
 <codesample lang="ebuild">
 pkg_postinst() {
-       if [[ -e "${ROOT}/etc/oldconfig" ]]; then
+       if [[ -e "${ROOT}etc/oldconfig" ]]; then
                ewarn "You still have the obsolete config file "
-               ewarn "    ${ROOT}/etc/oldconfig."
-               ewarn "Please migrate your settings to ${ROOT}/etc/newconfig"
-               ewarn "and remove ${ROOT}/etc/oldconfig."
+               ewarn "    ${ROOT}etc/oldconfig."
+               ewarn "Please migrate your settings to ${ROOT}etc/newconfig"
+               ewarn "and remove ${ROOT}etc/oldconfig."
        fi
 }
 </codesample>
+
+The <c>ROOT</c> variable always ends in a trailing slash. Therefore,
+there is no need to prefix it with <c>/</c> when joining paths.
 </p>
 
+<note>
+Future EAPI may remove the trailing slash at the end per
+<uri link="https://bugs.gentoo.org/465772";>Bug 465722</uri>.
+Developers can use <c>${ROOT%/}</c> to ensure maximum compatibility
+with both the current and the future EAPI.
+</note>
+
+
 </body>
 </section>
 

Reply via email to