commit:     22a1d52757839047e6edaee3f84731d2e50ca064
Author:     Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
AuthorDate: Mon Jan 25 22:50:20 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Sun Feb 14 16:46:00 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22a1d527

kde5-functions.eclass: add_category_dep: Implement slot/op override

Also fixes subslot awareness.

 eclass/kde5-functions.eclass | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass
index 74a3e24..68607ff 100644
--- a/eclass/kde5-functions.eclass
+++ b/eclass/kde5-functions.eclass
@@ -105,7 +105,7 @@ _add_category_dep() {
        local package=${2}
        local use=${3}
        local version=${4}
-       local slot=
+       local slot=${5}
 
        if [[ -n ${use} ]] ; then
                local use="[${use}]"
@@ -116,8 +116,10 @@ _add_category_dep() {
                local version="-$(get_version_component_range 1-3 ${version})"
        fi
 
-       if [[ ${SLOT} = 4 || ${SLOT} = 5 ]] && ! has kde5-meta-pkg ${INHERITED} 
; then
-               slot=":${SLOT}"
+       if [[ -n ${slot} ]] ; then
+               slot=":${slot}"
+       elif [[ ${SLOT%\/*} = 4 || ${SLOT%\/*} = 5 ]] && ! has kde5-meta-pkg 
${INHERITED} ; then
+               slot=":${SLOT%\/*}"
        fi
 
        echo " ${operator}${category}/${package}${version}${slot}${use}"
@@ -210,9 +212,11 @@ add_kdeapps_dep() {
 # @USAGE: <package> [USE flags] [minimum version]
 # @DESCRIPTION:
 # Create proper dependency for dev-qt/ dependencies.
-# This takes 1 to 3 arguments. The first being the package name, the optional
+# This takes 1 to 4 arguments. The first being the package name, the optional
 # second is additional USE flags to append, and the optional third is the
-# version to use instead of the automatic version (use sparingly).
+# version to use instead of the automatic version (use sparingly). In addition,
+# the optional fourth argument defines slot+operator instead of automatic slot
+# (use even more sparingly).
 # The output of this should be added directly to DEPEND/RDEPEND, and may be
 # wrapped in a USE conditional (but not an || conditional without an extra set
 # of parentheses).
@@ -227,7 +231,7 @@ add_qt_dep() {
                version=${QT_MINIMAL}
        fi
 
-       _add_category_dep dev-qt "${1}" "${2}" "${version}"
+       _add_category_dep dev-qt "${1}" "${2}" "${version}" "${4}"
 }
 
 # @FUNCTION: get_kde_version

Reply via email to