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 6/7] systemd.eclass: Allow systemd_update_catalog only during pkg_post*
Date: Fri, 27 Nov 2015 14:57:52
Message-Id: 1448636008-13184-7-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCHES] systemd.eclass: Clean up & EAPI 6 support by "Michał Górny"
1 ---
2 eclass/systemd.eclass | 5 ++++-
3 1 file changed, 4 insertions(+), 1 deletion(-)
4
5 diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
6 index a9ec26d..47ceffe 100644
7 --- a/eclass/systemd.eclass
8 +++ b/eclass/systemd.eclass
9 @@ -344,7 +344,7 @@ systemd_with_utildir() {
10 # @FUNCTION: systemd_update_catalog
11 # @DESCRIPTION:
12 # Update the journald catalog. This needs to be called after installing
13 -# or removing catalog files.
14 +# or removing catalog files. This must be called in pkg_post* phases.
15 #
16 # If systemd is not installed, no operation will be done. The catalog
17 # will be (re)built once systemd is installed.
18 @@ -353,6 +353,9 @@ systemd_with_utildir() {
19 systemd_update_catalog() {
20 debug-print-function ${FUNCNAME} "${@}"
21
22 + [[ ${EBUILD_PHASE} == post* ]] \
23 + || die "${FUNCNAME} disallowed during ${EBUILD_PHASE_FUNC:-${EBUILD_PHASE}}"
24 +
25 # Make sure to work on the correct system.
26
27 local journalctl=${EPREFIX}/usr/bin/journalctl
28 --
29 2.6.3