diff options
author | Michał Górny <mgorny@gentoo.org> | 2011-06-19 16:05:10 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2011-06-19 16:05:10 +0000 |
commit | 5ab3a61e744a00dd9d369e1b0b7c94cc84b78db4 (patch) | |
tree | 9cd1ab3e759014f2beb342d0c7ecb9242b4d6948 /eclass/systemd.eclass | |
parent | Version bump (diff) | |
download | historical-5ab3a61e744a00dd9d369e1b0b7c94cc84b78db4.tar.gz historical-5ab3a61e744a00dd9d369e1b0b7c94cc84b78db4.tar.bz2 historical-5ab3a61e744a00dd9d369e1b0b7c94cc84b78db4.zip |
Add systemd_newunit() to handle @-related renames gracefully.
Diffstat (limited to 'eclass/systemd.eclass')
-rw-r--r-- | eclass/systemd.eclass | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass index 34106223795d..2396eaefed71 100644 --- a/eclass/systemd.eclass +++ b/eclass/systemd.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.4 2011/06/16 16:39:18 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.5 2011/06/19 16:05:10 mgorny Exp $ # @ECLASS: systemd.eclass # @MAINTAINER: @@ -54,6 +54,20 @@ systemd_dounit() { ) } +# @FUNCTION: systemd_newunit +# @USAGE: oldname newname +# @DESCRIPTION: +# Install systemd unit with a new name. Uses newins, thus it is fatal +# in EAPI 4 and non-fatal in earlier EAPIs. +systemd_newunit() { + debug-print-function ${FUNCNAME} "${@}" + + ( + insinto "$(systemd_get_unitdir)" + newins "${@}" + ) +} + # @FUNCTION: systemd_dotmpfilesd # @USAGE: tmpfilesd1 [...] # @DESCRIPTION: |