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 systemd.eclass 1/2] Add a function to update journal catalogs.
Date: Sat, 29 Dec 2012 10:53:51
Message-Id: 1356778355-30324-1-git-send-email-mgorny@gentoo.org
1 This is to fix bug #449102 and potentially future bugs from packages
2 using journald (are there any?).
3 ---
4 gx86/eclass/systemd.eclass | 23 +++++++++++++++++++++++
5 1 file changed, 23 insertions(+)
6
7 diff --git a/gx86/eclass/systemd.eclass b/gx86/eclass/systemd.eclass
8 index 63f6ed0..1c11535 100644
9 --- a/gx86/eclass/systemd.eclass
10 +++ b/gx86/eclass/systemd.eclass
11 @@ -184,3 +184,26 @@ systemd_to_myeconfargs() {
12 --with-systemdsystemunitdir="$(systemd_get_unitdir)"
13 )
14 }
15 +
16 +# @FUNCTION: systemd_update_catalog
17 +# @DESCRIPTION:
18 +# Update the journald catalog. This needs to be called after installing
19 +# or removing catalog files.
20 +#
21 +# If systemd is not installed, no operation will be done. The catalog
22 +# will be (re)built once systemd is installed.
23 +#
24 +# See: http://www.freedesktop.org/wiki/Software/systemd/catalog
25 +systemd_update_catalog() {
26 + debug-print-function ${FUNCNAME} "${@}"
27 +
28 + # Make sure to work on the correct system.
29 + local journalctl=${EPREFIX}/usr/bin/journalctl
30 + if [[ -x ${journalctl} ]]; then
31 + ebegin "Updating systemd journal catalogs"
32 + journalctl --update-catalog
33 + eend $?
34 + else
35 + debug-print "${FUNCNAME}: journalctl not found."
36 + fi
37 +}
38 --
39 1.8.0.2

Replies