From ddb2705dd14e730e5910bcadd11715cc3fc363f1 Mon Sep 17 00:00:00 2001 From: Jonathan Callen Date: Fri, 11 Sep 2009 17:14:35 -0400 Subject: [eclass] Add a new add_kdebase_dep() function The add_kdebase_dep function takes 1-2 arguments, the first being the name of the package to depend upon, and the second being (optionally) extra USE deps. When given 1 argument, this function will output !kdeprefix? ( >=kde-base/$1-${PV}[-kdeprefix] ) kdeprefix? ( >=kde-base/$1-${PV}:${SLOT}[kdeprefix] ) And 2 arguments outputs !kdeprefix? ( >=kde-base/$1-${PV}[-kdeprefix,$2] ) kdeprefix? ( >=kde-base/$1-${PV}:${SLOT}[kdeprefix,$2] ) These are the proper deps to replace >=kde-base/PKG-${PV}:${SLOT}[kdeprefix=,USEDEPS] as it does not force an all-at-once upgrade of everything. Some of the deps (the ones from kde4-base.eclass) were already in this form, so there was an odd combination of packages that could be installed in separate slots with -kdeprefix, and packages that couldn't. --- eclass/kde4-functions.eclass | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'eclass/kde4-functions.eclass') diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass index ca143ff8c96..419272a6f58 100644 --- a/eclass/kde4-functions.eclass +++ b/eclass/kde4-functions.eclass @@ -399,3 +399,23 @@ add_blocker() { # on kdeprefix we block only our slot RDEPEND+=" kdeprefix? ( !<=kde-base/${1}-${2}:${SLOT}[kdeprefix] )" } + +# @FUNCTION: add_kdebase_dep +# @DESCRIPTION: +# Create proper dependency for kde-base/ dependencies, +# adding SLOT when needed (and *only* when needed). +# This takes 1 or 2 arguments. The first being the package +# name, the optional second, is additional USE flags to append. +# 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. +add_kdebase_dep() { + debug-print-function ${FUNCNAME} "$@" + + [[ -z ${1} ]] && die "Missing parameter" + + local use=${2:+,${2}} + + echo "!kdeprefix? ( >=kde-base/${1}-${PV}[-kdeprefix${use}] )" + echo "kdeprefix? ( >=kde-base/${1}-${PV}:${SLOT}[kdeprefix${use}] )" +} -- cgit v1.2.3