Gentoo Archives: gentoo-commits

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:master commit in: ebuild-writing/variables/
Date: Wed, 13 Jul 2016 02:49:02
Message-Id: 1467603975.57778b90ee0f252bb4b295f3b0053e9a581b85fb.gokturk@gentoo
1 commit: 57778b90ee0f252bb4b295f3b0053e9a581b85fb
2 Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 1 14:42:02 2016 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 4 03:46:15 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=57778b90
7
8 ebuild-writing/variables: update wrt ROOT always ending in a trailing slash
9
10 Per PMS[0], ROOT must end in a trailing slash. Remove the trailing
11 slash characters ('/') that appear after ${ROOT} in the example and
12 add a note about it.
13
14 There is a future EAPI request to remove this trailing slash
15 (#465722). Suggest the use of '${EROOT%/}' for maximum compatibility.
16
17 [0] https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-11900011.1
18
19 ebuild-writing/variables/text.xml | 19 +++++++++++++++----
20 1 file changed, 15 insertions(+), 4 deletions(-)
21
22 diff --git a/ebuild-writing/variables/text.xml b/ebuild-writing/variables/text.xml
23 index 3f99cfb..7368525 100644
24 --- a/ebuild-writing/variables/text.xml
25 +++ b/ebuild-writing/variables/text.xml
26 @@ -431,16 +431,27 @@ old and obsolete configuration file still exists:
27
28 <codesample lang="ebuild">
29 pkg_postinst() {
30 - if [[ -e "${ROOT}/etc/oldconfig" ]]; then
31 + if [[ -e "${ROOT}etc/oldconfig" ]]; then
32 ewarn "You still have the obsolete config file "
33 - ewarn " ${ROOT}/etc/oldconfig."
34 - ewarn "Please migrate your settings to ${ROOT}/etc/newconfig"
35 - ewarn "and remove ${ROOT}/etc/oldconfig."
36 + ewarn " ${ROOT}etc/oldconfig."
37 + ewarn "Please migrate your settings to ${ROOT}etc/newconfig"
38 + ewarn "and remove ${ROOT}etc/oldconfig."
39 fi
40 }
41 </codesample>
42 +
43 +The <c>ROOT</c> variable always ends in a trailing slash. Therefore,
44 +there is no need to prefix it with <c>/</c> when joining paths.
45 </p>
46
47 +<note>
48 +Future EAPI may remove the trailing slash at the end per
49 +<uri link="https://bugs.gentoo.org/465772">Bug 465722</uri>.
50 +Developers can use <c>${ROOT%/}</c> to ensure maximum compatibility
51 +with both the current and the future EAPI.
52 +</note>
53 +
54 +
55 </body>
56 </section>