systemd.eclass: Ban systemd_with_* in EAPI 6
authorMichał Górny <mgorny@gentoo.org>
Fri, 27 Nov 2015 14:40:21 +0000 (15:40 +0100)
committerMichał Górny <mgorny@gentoo.org>
Tue, 1 Dec 2015 22:07:17 +0000 (23:07 +0100)
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

index 8ec0c5d81384a8eb5384d05c01ba29e495e7baa5..c0c21a1426f60e1869f661d8c7a79b240912e840 100644 (file)
@@ -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)"