kde5-functions.eclass: Fix default version handling
authorAndreas Sturmlechner <asturm@gentoo.org>
Mon, 25 Sep 2017 15:41:53 +0000 (17:41 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Thu, 26 Oct 2017 08:22:31 +0000 (10:22 +0200)
- don't cut off version components in add_category_dep, instead do it
  in add_plasma_dep and add_kdeapps_dep

eclass/kde5-functions.eclass

index fca63e07507d667eeef1fe124cf297d0b2606be6..47e1e969b42df39e23dcc04fb74f06323d2d41e7 100644 (file)
@@ -142,7 +142,7 @@ _add_category_dep() {
 
        if [[ -n ${version} ]] ; then
                local operator=">="
-               local version="-$(get_version_component_range 1-3 ${version})"
+               local version="-${version}"
        fi
 
        if [[ -n ${slot} ]] ; then
@@ -179,7 +179,7 @@ add_frameworks_dep() {
                version=${3}
        elif [[ ${CATEGORY} = kde-frameworks ]]; then
                version=$(get_version_component_range 1-2)
-       elif [[ -z "${version}" ]] ; then
+       elif [[ -z ${3} ]] ; then
                version=${FRAMEWORKS_MINIMAL}
        fi
 
@@ -210,8 +210,8 @@ add_plasma_dep() {
        if [[ -n ${3} ]]; then
                version=${3}
        elif [[ ${CATEGORY} = kde-plasma ]]; then
-               version=${PV}
-       elif [[ -z "${version}" ]] ; then
+               version=$(get_version_component_range 1-3)
+       elif [[ -z ${3} ]] ; then
                version=${PLASMA_MINIMAL}
        fi
 
@@ -242,8 +242,8 @@ add_kdeapps_dep() {
        if [[ -n ${3} ]]; then
                version=${3}
        elif [[ ${CATEGORY} = kde-apps ]]; then
-               version=${PV}
-       elif [[ -z "${version}" ]] ; then
+               version=$(get_version_component_range 1-3)
+       elif [[ -z ${3} ]] ; then
                version=${KDE_APPS_MINIMAL}
        fi
 
@@ -269,15 +269,12 @@ add_qt_dep() {
                die "${FUNCNAME} was called with too many arguments"
        fi
 
-       local version
+       local version=${3}
        local slot=${4}
 
-       if [[ -n ${3} ]]; then
-               version=${3}
-       elif [[ -z "${version}" ]]; then
+       if [[ -z ${version} ]]; then
                version=${QT_MINIMAL}
        fi
-
        if [[ -z ${slot} ]]; then
                slot="5"
        fi