diff options
author | Michał Górny <mgorny@gentoo.org> | 2012-12-31 13:08:12 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2012-12-31 13:08:12 +0000 |
commit | c0fbd27e386c57ab5737e89dc035b8450c2e2438 (patch) | |
tree | 14411603bd100fad16185788000494759225e396 /eclass | |
parent | Use virtual/pyparsing. (diff) | |
download | gentoo-2-c0fbd27e386c57ab5737e89dc035b8450c2e2438.tar.gz gentoo-2-c0fbd27e386c57ab5737e89dc035b8450c2e2438.tar.bz2 gentoo-2-c0fbd27e386c57ab5737e89dc035b8450c2e2438.zip |
Add function to update systemd journal catalog database.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/systemd.eclass | 25 |
2 files changed, 28 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 4c9e44db2c39..8ee22daa383c 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.583 2012/12/31 09:27:00 hd_brummy Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.584 2012/12/31 13:08:12 mgorny Exp $ + + 31 Dec 2012; Michał Górny <mgorny@gentoo.org> systemd.eclass: + Add function to update systemd journal catalog database. 31 Dec 2012; Joerg Bornkessel <hd_brummy@gentoo.org> vdr-plugin-2.eclass: vdr-plugin-2.eclass; better detection of new Makefile handling, fixed some diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass index 63f6ed0cd424..01ac05015d29 100644 --- a/eclass/systemd.eclass +++ b/eclass/systemd.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.19 2012/11/21 09:06:42 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.20 2012/12/31 13:08:12 mgorny Exp $ # @ECLASS: systemd.eclass # @MAINTAINER: @@ -184,3 +184,26 @@ systemd_to_myeconfargs() { --with-systemdsystemunitdir="$(systemd_get_unitdir)" ) } + +# @FUNCTION: systemd_update_catalog +# @DESCRIPTION: +# Update the journald catalog. This needs to be called after installing +# or removing catalog files. +# +# If systemd is not installed, no operation will be done. The catalog +# will be (re)built once systemd is installed. +# +# See: http://www.freedesktop.org/wiki/Software/systemd/catalog +systemd_update_catalog() { + debug-print-function ${FUNCNAME} "${@}" + + # Make sure to work on the correct system. + local journalctl=${EPREFIX}/usr/bin/journalctl + if [[ -x ${journalctl} ]]; then + ebegin "Updating systemd journal catalogs" + journalctl --update-catalog + eend $? + else + debug-print "${FUNCNAME}: journalctl not found." + fi +} |