summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2015-11-27 15:44:48 +0100
committerMichał Górny <mgorny@gentoo.org>2015-12-01 23:07:17 +0100
commit45e18362449d6630cc3036b9595b39c73ee5b9fa (patch)
treebfb76eb675e9ce47169685efc4ec716667f098fe /eclass/systemd.eclass
parentsystemd.eclass: Ban systemd_with_* in EAPI 6 (diff)
downloadgentoo-45e18362449d6630cc3036b9595b39c73ee5b9fa.tar.gz
gentoo-45e18362449d6630cc3036b9595b39c73ee5b9fa.tar.bz2
gentoo-45e18362449d6630cc3036b9595b39c73ee5b9fa.zip
systemd.eclass: Allow systemd_update_catalog only during pkg_post*
Diffstat (limited to 'eclass/systemd.eclass')
-rw-r--r--eclass/systemd.eclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index c0c21a1426f6..ae933aad8cd3 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -353,7 +353,7 @@ systemd_with_utildir() {
# @FUNCTION: systemd_update_catalog
# @DESCRIPTION:
# Update the journald catalog. This needs to be called after installing
-# or removing catalog files.
+# or removing catalog files. This must be called in pkg_post* phases.
#
# If systemd is not installed, no operation will be done. The catalog
# will be (re)built once systemd is installed.
@@ -362,6 +362,9 @@ systemd_with_utildir() {
systemd_update_catalog() {
debug-print-function ${FUNCNAME} "${@}"
+ [[ ${EBUILD_PHASE} == post* ]] \
+ || die "${FUNCNAME} disallowed during ${EBUILD_PHASE_FUNC:-${EBUILD_PHASE}}"
+
# Make sure to work on the correct system.
local journalctl=${EPREFIX}/usr/bin/journalctl