From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0316D1384B4 for ; Mon, 30 Nov 2015 15:02:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D937621C09A; Mon, 30 Nov 2015 15:01:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1408621C057 for ; Mon, 30 Nov 2015 15:01:32 +0000 (UTC) Received: from localhost.localdomain (d202-251.icpnet.pl [109.173.202.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 8EEF7340649; Mon, 30 Nov 2015 15:01:30 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 2/8] systemd.eclass: systemd_get_unitdir -> *systemunitdir for consistency Date: Mon, 30 Nov 2015 16:01:16 +0100 Message-Id: <1448895682-19312-3-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1448895682-19312-1-git-send-email-mgorny@gentoo.org> References: <1448636008-13184-1-git-send-email-mgorny@gentoo.org> <1448895682-19312-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 43d6c82e-9eb2-4990-88fc-0c5d1ae55eab X-Archives-Hash: 7e110f126217554418eea3fb420c89eb Rename systemd_get_unitdir to systemd_get_systemunitdir for consistency with other functions. Ban the old name in EAPI 6 onwards. --- eclass/systemd.eclass | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass index 245e803..7dd914a 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)" ) } -- 2.6.3