commit:     f6ffff4a5b235a99225ae4e41ecceeae462aa567
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 14:40:21 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec  1 22:07:17 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6ffff4a

systemd.eclass: Ban systemd_with_* in EAPI 6

Deprecate systemd_with_* and ban it in EAPI 6. Those are only
convenience wrappers for systemd_get_* which barely save typing and are
much less readable than explicit --with-* parameters.

 eclass/systemd.eclass | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 8ec0c5d..c0c21a1 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -313,6 +313,9 @@ systemd_enable_ntpunit() {
 # @FUNCTION: systemd_with_unitdir
 # @USAGE: [<configure-option-name>]
 # @DESCRIPTION:
+# Note: deprecated and banned in EAPI 6. Please use full --with-...=
+# parameter for improved ebuild readability.
+#
 # Output '--with-systemdsystemunitdir' as expected by systemd-aware configure
 # scripts. This function always succeeds. Its output may be quoted in order
 # to preserve whitespace in paths. systemd_to_myeconfargs() is preferred over
@@ -323,6 +326,8 @@ systemd_enable_ntpunit() {
 # argument to this function (`$(systemd_with_unitdir systemdunitdir)'). Please
 # remember to report a bug upstream as well.
 systemd_with_unitdir() {
+       [[ ${EAPI:-0} != [012345] ]] && die "${FUNCNAME} is banned in EAPI 
${EAPI}, use 
--with-${1:-systemdsystemunitdir}=\"\$(systemd_get_systemunitdir)\" instead"
+
        debug-print-function ${FUNCNAME} "${@}"
        local optname=${1:-systemdsystemunitdir}
 
@@ -331,10 +336,15 @@ systemd_with_unitdir() {
 
 # @FUNCTION: systemd_with_utildir
 # @DESCRIPTION:
+# Note: deprecated and banned in EAPI 6. Please use full --with-...=
+# parameter for improved ebuild readability.
+#
 # Output '--with-systemdsystemutildir' as used by some packages to install
 # systemd helpers. This function always succeeds. Its output may be quoted
 # in order to preserve whitespace in paths.
 systemd_with_utildir() {
+       [[ ${EAPI:-0} != [012345] ]] && die "${FUNCNAME} is banned in EAPI 
${EAPI}, use --with-systemdutildir=\"\$(systemd_get_utildir)\" instead"
+
        debug-print-function ${FUNCNAME} "${@}"
 
        echo --with-systemdutildir="$(systemd_get_utildir)"

Reply via email to