summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2011-06-19 16:05:10 +0000
committerMichał Górny <mgorny@gentoo.org>2011-06-19 16:05:10 +0000
commitcf0dd1f1a4a70527e881999c88717b5f78f51517 (patch)
tree8d9505250f59ca96f01c6f4987a0667b3ebdf1d2
parentVersion bump (diff)
downloadgentoo-2-cf0dd1f1a4a70527e881999c88717b5f78f51517.tar.gz
gentoo-2-cf0dd1f1a4a70527e881999c88717b5f78f51517.tar.bz2
gentoo-2-cf0dd1f1a4a70527e881999c88717b5f78f51517.zip
Add systemd_newunit() to handle @-related renames gracefully.
-rw-r--r--eclass/systemd.eclass16
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: