* [gentoo-dev] [PATCH systemd.eclass 1/2] Add a function to update journal catalogs.
@ 2012-12-29 10:52 Michał Górny
2012-12-29 10:52 ` [gentoo-dev] [PATCH systemd.eclass 2/2] Update and remove catalog database in systemd ebuild Michał Górny
0 siblings, 1 reply; 2+ messages in thread
From: Michał Górny @ 2012-12-29 10:52 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
This is to fix bug #449102 and potentially future bugs from packages
using journald (are there any?).
---
gx86/eclass/systemd.eclass | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/gx86/eclass/systemd.eclass b/gx86/eclass/systemd.eclass
index 63f6ed0..1c11535 100644
--- a/gx86/eclass/systemd.eclass
+++ b/gx86/eclass/systemd.eclass
@@ -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
+}
--
1.8.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-dev] [PATCH systemd.eclass 2/2] Update and remove catalog database in systemd ebuild.
2012-12-29 10:52 [gentoo-dev] [PATCH systemd.eclass 1/2] Add a function to update journal catalogs Michał Górny
@ 2012-12-29 10:52 ` Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2012-12-29 10:52 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=449102
---
gx86/sys-apps/systemd/systemd-9999.ebuild | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gx86/sys-apps/systemd/systemd-9999.ebuild b/gx86/sys-apps/systemd/systemd-9999.ebuild
index ae3feb7..42f1cef 100644
--- a/gx86/sys-apps/systemd/systemd-9999.ebuild
+++ b/gx86/sys-apps/systemd/systemd-9999.ebuild
@@ -205,6 +205,8 @@ optfeature() {
}
pkg_postinst() {
+ systemd_update_catalog
+
mkdir -p "${ROOT}"/run || ewarn "Unable to mkdir /run, this could mean trouble."
if [[ ! -L "${ROOT}"/etc/mtab ]]; then
ewarn "Upstream suggests that the /etc/mtab file should be a symlink to /proc/mounts."
@@ -230,3 +232,10 @@ pkg_postinst() {
ewarn " init=/sbin/init"
ewarn "to your kernel to boot using sysvinit / OpenRC."
}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
--
1.8.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-29 10:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-29 10:52 [gentoo-dev] [PATCH systemd.eclass 1/2] Add a function to update journal catalogs Michał Górny
2012-12-29 10:52 ` [gentoo-dev] [PATCH systemd.eclass 2/2] Update and remove catalog database in systemd ebuild Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox