Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 3/3] app-portage/eix: Convert to tmpfiles.eclass (example)
Date: Sun, 30 Apr 2017 19:08:48
Message-Id: 20170430190655.9946-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/3] tmpfiles.eclass: Support using on non-Linux systems by "Michał Górny"
1 Replace the use of systemd.eclass with more generic tmpfiles.eclass to
2 install the tmpfiles.d file. Use tmpfiles_process to ensure that
3 the directory is created and correctly owned instead of keepdir-ing it
4 (which triggers QA warnings from Portage) and chown-ing it
5 in pkg_postinst() (which is a hack to workaround Portage design issues).
6 ---
7 app-portage/eix/{eix-0.32.5-r1.ebuild => eix-0.32.5-r2.ebuild} | 8 +++-----
8 1 file changed, 3 insertions(+), 5 deletions(-)
9 rename app-portage/eix/{eix-0.32.5-r1.ebuild => eix-0.32.5-r2.ebuild} (93%)
10
11 diff --git a/app-portage/eix/eix-0.32.5-r1.ebuild b/app-portage/eix/eix-0.32.5-r2.ebuild
12 similarity index 93%
13 rename from app-portage/eix/eix-0.32.5-r1.ebuild
14 rename to app-portage/eix/eix-0.32.5-r2.ebuild
15 index 2026b44a4b15..1d6fa3801834 100644
16 --- a/app-portage/eix/eix-0.32.5-r1.ebuild
17 +++ b/app-portage/eix/eix-0.32.5-r2.ebuild
18 @@ -4,7 +4,7 @@
19 EAPI=6
20
21 PLOCALES="de ru"
22 -inherit autotools bash-completion-r1 l10n systemd flag-o-matic
23 +inherit autotools bash-completion-r1 l10n flag-o-matic tmpfiles
24
25 DESCRIPTION="Search and query ebuilds"
26 HOMEPAGE="https://github.com/vaeth/eix/"
27 @@ -83,20 +83,18 @@ src_configure() {
28 src_install() {
29 default
30 dobashcomp bash/eix
31 - systemd_dotmpfilesd tmpfiles.d/eix.conf
32 + dotmpfiles tmpfiles.d/eix.conf
33
34 insinto /usr/share/${PN}
35 doins "${ED}"/usr/bin/eix-functions.sh
36 rm -r "${ED}"/usr/bin/eix-functions.sh || die
37 -
38 - keepdir /var/cache/eix
39 }
40
41 pkg_postinst() {
42 if ! use prefix; then
43 # note: if this is done in src_install(), portage:portage
44 # ownership may be reset to root
45 - chown portage:portage "${EROOT%/}"/var/cache/eix || die
46 + tmpfiles_process eix.conf
47 fi
48
49 local obs=${EROOT%/}/var/cache/eix.previous
50 --
51 2.13.0.rc1