diff options
author | Michał Górny <mgorny@gentoo.org> | 2015-11-30 15:48:49 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2015-12-01 23:07:17 +0100 |
commit | 742bcd6875a618c936bd0afe9d49d8725aa872b6 (patch) | |
tree | 9b19bfb46eba06b5ed25240b1e2881684759c167 /eclass/systemd.eclass | |
parent | systemd.eclass: Introduce a common getter for systemd directories (diff) | |
download | gentoo-742bcd6875a618c936bd0afe9d49d8725aa872b6.tar.gz gentoo-742bcd6875a618c936bd0afe9d49d8725aa872b6.tar.bz2 gentoo-742bcd6875a618c936bd0afe9d49d8725aa872b6.zip |
systemd.eclass: systemd_get_unitdir -> *systemunitdir for consistency
Rename systemd_get_unitdir to systemd_get_systemunitdir for consistency
with other functions. Ban the old name in EAPI 6 onwards.
Diffstat (limited to 'eclass/systemd.eclass')
-rw-r--r-- | eclass/systemd.eclass | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass index 245e8034db81..7dd914a358a9 100644 --- a/eclass/systemd.eclass +++ b/eclass/systemd.eclass @@ -58,19 +58,29 @@ _systemd_get_dir() { # @INTERNAL # @DESCRIPTION: # Get unprefixed unitdir. -_systemd_get_unitdir() { +_systemd_get_systemunitdir() { _systemd_get_dir systemdsystemunitdir /usr/lib/systemd/system } -# @FUNCTION: systemd_get_unitdir +# @FUNCTION: systemd_get_systemunitdir # @DESCRIPTION: -# Output the path for the systemd unit directory (not including ${D}). -# This function always succeeds, even if systemd is not installed. -systemd_get_unitdir() { +# Output the path for the systemd system unit directory (not including +# ${D}). This function always succeeds, even if systemd is not +# installed. +systemd_get_systemunitdir() { has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= debug-print-function ${FUNCNAME} "${@}" - echo "${EPREFIX}$(_systemd_get_unitdir)" + echo "${EPREFIX}$(_systemd_get_systemunitdir)" +} + +# @FUNCTION: systemd_get_unitdir +# @DESCRIPTION: +# Deprecated alias for systemd_get_systemunitdir. +systemd_get_unitdir() { + [[ ${EAPI} == [012345] ]] || die "${FUNCNAME} is banned in EAPI 6, use systemd_get_systemunitdir instead" + + systemd_get_systemunitdir } # @FUNCTION: _systemd_get_userunitdir @@ -122,7 +132,7 @@ systemd_dounit() { debug-print-function ${FUNCNAME} "${@}" ( - insinto "$(_systemd_get_unitdir)" + insinto "$(_systemd_get_systemunitdir)" doins "${@}" ) } @@ -136,7 +146,7 @@ systemd_newunit() { debug-print-function ${FUNCNAME} "${@}" ( - insinto "$(_systemd_get_unitdir)" + insinto "$(_systemd_get_systemunitdir)" newins "${@}" ) } @@ -247,7 +257,7 @@ systemd_enable_service() { local target=${1} local service=${2} - local ud=$(_systemd_get_unitdir) + local ud=$(_systemd_get_systemunitdir) local destname=${service##*/} dodir "${ud}"/"${target}".wants && \ @@ -281,7 +291,7 @@ systemd_enable_ntpunit() { die "The .list suffix is appended implicitly to ntpunit.d name." fi - local unitdir=$(systemd_get_unitdir) + local unitdir=$(systemd_get_systemunitdir) local s for s in "${services[@]}"; do if [[ ! -f "${D}${unitdir}/${s}" ]]; then @@ -317,7 +327,7 @@ systemd_with_unitdir() { debug-print-function ${FUNCNAME} "${@}" local optname=${1:-systemdsystemunitdir} - echo --with-${optname}="$(systemd_get_unitdir)" + echo --with-${optname}="$(systemd_get_systemunitdir)" } # @FUNCTION: systemd_with_utildir @@ -344,7 +354,7 @@ systemd_to_myeconfargs() { myeconfargs=( "${myeconfargs[@]}" - --with-systemdsystemunitdir="$(systemd_get_unitdir)" + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" ) } |