Gentoo Archives: gentoo-pms

From: Ulrich Mueller <ulm@g.o>
To: gentoo-pms@l.g.o
Subject: [gentoo-pms] [PATCH] Re: Write to filesystem in pkg_* phases
Date: Fri, 26 Jun 2020 10:39:37
Message-Id: uimfe2js4@gentoo.org
In Reply to: [gentoo-pms] Write to filesystem in pkg_* phases by Ulrich Mueller
1 >>>>> On Mon, 02 Jun 2014, Ulrich Mueller wrote:
2
3 > This topic was already discussed in -dev some time ago [1], but went
4 > nowhere at the time. Now it came up again in bug 469210 [2].
5 > (Ironically, checking for a particular kernel configuration is the
6 > example mentioned in the spec for pkg_pretend.)
7
8 > We say in Table 11.1 [3] that T and TMPDIR (and HOME) are legal in all
9 > phases and must be "the location of a usable temporary directory". At
10 > the same time, we say in the spec for pkg_* phases that they "must not
11 > write to the filesystem" [4], or that they "must not write outside of
12 > the directories specified by the ROOT and D environment variables" [5]
13 > which effectively forbids writing to the ${T} etc. directories.
14
15 > What is the purpose of this restriction? From above mentioned bug I
16 > conclude that neither Portage nor Paludis enforce it.
17
18 Coming back to this. As I have been told, the same is true for Pkgcore.
19 So, find a patch included below. Please review.
20
21 Ulrich
22
23 > [1] https://archives.gentoo.org/gentoo-dev/msg_ea6dce57c39ff597afdca7ba74f7cc73.xml
24 > [2] https://bugs.gentoo.org/show_bug.cgi?id=469210
25 > [3] http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-118002
26 > [4] http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-960009.1.2
27 > [5] http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-1040009.1.10
28
29 From 00cc505965ff8d3cb4d71b4e6eee76168f37d642 Mon Sep 17 00:00:00 2001
30 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@g.o>
31 Date: Thu, 25 Jun 2020 20:38:51 +0200
32 Subject: [PATCH] ebuild-functions.tex: Phase functions can write to temporary
33 dirs.
34 MIME-Version: 1.0
35 Content-Type: text/plain; charset=UTF-8
36 Content-Transfer-Encoding: 8bit
37
38 All package managers support that functions like pkg_pretend() write
39 to temporary directories T, TMPDIR and HOME. This is also used in the
40 tree, see for example bug 469210. Update the spec to match this.
41
42 Signed-off-by: Ulrich Müller <ulm@g.o>
43 ---
44 ebuild-functions.tex | 11 ++++++-----
45 1 file changed, 6 insertions(+), 5 deletions(-)
46
47 diff --git a/ebuild-functions.tex b/ebuild-functions.tex
48 index 4a13db6..3935800 100644
49 --- a/ebuild-functions.tex
50 +++ b/ebuild-functions.tex
51 @@ -6,11 +6,12 @@
52 The following is a list of functions that an ebuild, or eclass, may define, and which will be called
53 by the package manager as part of the build and/or install process. In all cases the package manager
54 must provide a default implementation of these functions; unless otherwise stated this must be a
55 -no-op. Most functions must assume only that they have write access to the package's working
56 -directory (the \t{WORKDIR} environment variable; see section~\ref{sec:ebuild-env-vars}), and the
57 -temporary directory \t{T}; exceptions are noted below. All functions may assume that they have read
58 -access to all system libraries, binaries and configuration files that are accessible to normal
59 -users.
60 +no-op. All functions may assume that they have read access to all system libraries, binaries and
61 +configuration files that are accessible to normal users, as well as write access to the temporary
62 +directories specified by the \t{T}, \t{TMPDIR} and \t{HOME} environment variables
63 +(see section~\ref{sec:ebuild-env-vars}). Most functions must assume only that they have additional
64 +write access to the package's working directory (the \t{WORKDIR} environment variable); exceptions
65 +are noted below.
66
67 The environment for functions run outside of the build sequence (that is, \t{pkg_config},
68 \t{pkg_info}, \t{pkg_prerm} and \t{pkg_postrm}) must be the environment used for the build of the
69 --
70 2.27.0

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies