Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>, zmedico@g.o
Subject: Re: [gentoo-dev] What's going on with the tmpfiles eclasses?
Date: Thu, 25 Apr 2019 21:25:12
Message-Id: CAJ0EP41tRsdv=9fSfph8jHB9w0ygW=8E6sMyqADKz0tDWTesaA@mail.gmail.com
In Reply to: Re: [gentoo-dev] What's going on with the tmpfiles eclasses? by Zac Medico
1 On Tue, Apr 23, 2019 at 6:25 PM Zac Medico <zmedico@g.o> wrote:
2 >
3 > On 4/23/19 2:03 PM, Michael Orlitzky wrote:
4 > > We have two eclasses with almost-identical functions for handling
5 > > tmpfiles.d entries:
6 > >
7 > > 1. systemd.eclass
8 > >
9 > > a. systemd_dotmpfilesd
10 > > b. systemd_newtmpfilesd
11 > > c. systemd_tmpfiles_create
12 > >
13 > > 2. tmpfiles.eclass
14 > >
15 > > a. dotmpfiles
16 > > b. newtmpfiles
17 > > c. tmpfiles_process
18 > >
19 > > The do/new functions are basically identical, while the create/process
20 > > functions differ only in the fact that the one from tmpfiles.eclass
21 > > supports opentmpfiles as well. Why do we have both? Couldn't the
22 > > systemd.eclass ones be implemented in terms of the tmpfiles.eclass ones,
23 > > and then deprecated (in favor of tmpfiles.eclass itself) in newer EAPIs?
24 > >
25 > > Or am I missing something?
26 >
27 > Note that systemd.eclass is lighter on dependencies, which is why I
28 > chose it for the solution to bug 490676 [1] and bug 643386 [2] in the
29 > sys-apps/portage ebuilds.
30 >
31 > [1] https://bugs.gentoo.org/490676
32 > [2] https://bugs.gentoo.org/643386
33
34 Having reviewed bug 643386, I would certainly call Portage's use of
35 tmpfiles.d to be a "special case". There is no reason to depend on
36 virtual/tmpfiles or to call tmpfiles --create in pkg_postinst.
37
38 I don't think relying on the functions in systemd.eclass is a great
39 solution. A couple of alternatives I would propose:
40
41 1. Add a magic variable to tmpfiles.eclass to disable the RDEPEND for
42 packages that do not need to call tmpfiles --create on postinst or on
43 system boot.
44 2. Revert back to insinto /usr/lib/tmpfiles.d and doins to avoid using
45 tmpfiles.eclass or systemd.eclass.

Replies

Subject Author
Re: [gentoo-dev] What's going on with the tmpfiles eclasses? "Michał Górny" <mgorny@g.o>