eclass: Drop EAPI 2 & 3 support in virtaulx.eclass
authorJustin Lecher <jlec@gentoo.org>
Sat, 6 Jan 2018 13:23:20 +0000 (13:23 +0000)
committerJustin Lecher <jlec@gentoo.org>
Sat, 6 Jan 2018 13:35:37 +0000 (13:35 +0000)
Signed-off-by: Justin Lecher <jlec@gentoo.org>
eclass/virtualx.eclass

index d66149b70baec957024cc1ad7c3b5b3e235bc62d..38e629eef4fe0e12fadd6899f78380f7cbe73285 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: virtualx.eclass
 if [[ ! ${_VIRTUAL_X} ]]; then
 
 case "${EAPI:-0}" in
-       0|1)
+       0|1|2|3)
                die "virtualx.eclass: EAPI ${EAPI} is too old."
                ;;
-       2|3|4|5|6)
+       4|5|6)
                ;;
        *)
                die "virtualx.eclass: EAPI ${EAPI} is not supported yet."
                ;;
 esac
 
-[[ ${EAPI} == [2345] ]] && inherit eutils
+[[ ${EAPI} == [45] ]] && inherit eutils
 
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
@@ -57,7 +57,7 @@ case ${VIRTUALX_REQUIRED} in
                RDEPEND=""
                ;;
        optional|tests)
-               [[ ${EAPI} == [2345] ]] \
+               [[ ${EAPI} == [45] ]] \
                        || die 'Values "optional" and "tests" for VIRTUALX_REQUIRED are banned in EAPI > 5'
                # deprecated section YAY.
                eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
@@ -90,12 +90,12 @@ esac
 virtualmake() {
        debug-print-function ${FUNCNAME} "$@"
 
-       [[ ${EAPI} == [2345] ]] \
+       [[ ${EAPI} == [45] ]] \
                || die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
 
        # backcompat for maketype
        if [[ -n ${maketype} ]]; then
-               [[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5"
+               [[ ${EAPI} == [45] ]] || die "maketype is banned in EAPI > 5"
                eqawarn "ebuild is exporting \$maketype=${maketype}"
                eqawarn "Ebuild should be migrated to use 'virtx command' instead."
                VIRTUALX_COMMAND=${maketype}
@@ -205,13 +205,8 @@ virtx() {
        # Do not break on error, but setup $retval, as we need
        # to kill Xvfb
        debug-print "${FUNCNAME}: $@"
-       if has "${EAPI}" 2 3; then
-               "$@"
-               retval=$?
-       else
-               nonfatal "$@"
-               retval=$?
-       fi
+       nonfatal "$@"
+       retval=$?
 
        # Now kill Xvfb
        kill $(cat /tmp/.X${XDISPLAY}-lock)
@@ -229,7 +224,7 @@ virtx() {
 Xmake() {
        debug-print-function ${FUNCNAME} "$@"
 
-       [[ ${EAPI} == [2345] ]] \
+       [[ ${EAPI} == [45] ]] \
                || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'"
 
        eqawarn "you should not execute make directly"
@@ -243,7 +238,7 @@ Xmake() {
 Xemake() {
        debug-print-function ${FUNCNAME} "$@"
 
-       [[ ${EAPI} == [2345] ]] \
+       [[ ${EAPI} == [45] ]] \
                || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'"
 
        VIRTUALX_COMMAND="emake" virtualmake "$@"
@@ -255,7 +250,7 @@ Xemake() {
 Xeconf() {
        debug-print-function ${FUNCNAME} "$@"
 
-       [[ ${EAPI} == [2345] ]] \
+       [[ ${EAPI} == [45] ]] \
                || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'"
 
        VIRTUALX_COMMAND="econf" virtualmake "$@"