From 4f25ad6974895fa286b79d0c9ef965166328fb2c Mon Sep 17 00:00:00 2001 From: Jonathan Callen Date: Fri, 11 Sep 2009 22:50:37 -0400 Subject: [eclass] Add features to add_blocker() in kde4-functions.eclass This now allows add_blocker to add just about any blocker that you would need for kde-base/ packages (that is, kde-base/ packages blocking other kde-base/ packages). In its simplest form, you can use add_blocker pkg-name to add a blocker on all kde-4 versions of kde-base/pkg-name. If further arguments are supplied, then those indicate which versions to block. There are 2 versions with special properties: 0 indicates that no version is to be blocked, and 4.x.50 indicates that all versions in slots <= 4.x are to be blocked. A version can also be specified with a slot, like "4.2.96:4.3", indicating that for that slot, that version is to be blocked. If no version is given with a slot (like ":4.3"), then all versions from that slot are blocked. By default, versions <= the given version are blocked. If the given version begins with "<", however, then versions < the given version are blocked. --- eclass/kde4-functions.eclass | 144 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 130 insertions(+), 14 deletions(-) (limited to 'eclass/kde4-functions.eclass') diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass index 419272a6f58..1581edbeeef 100644 --- a/eclass/kde4-functions.eclass +++ b/eclass/kde4-functions.eclass @@ -2,6 +2,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.18 2009/05/09 13:23:15 scarabeus Exp $ +inherit versionator + # Prefix compat: : ${EROOT:=${ROOT}} # Append missing trailing slash character @@ -372,32 +374,146 @@ load_library_dependencies() { block_other_slots() { debug-print-function ${FUNCNAME} "$@" - local slot - for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do - # Block non kdeprefix ${PN} on other slots - if [[ ${SLOT} != ${slot} ]]; then - echo "!kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] )" - fi - done + _do_blocker ${PN} 0:${SLOT} } # @FUNCTION: add_blocker # @DESCRIPTION: # Create correct RDEPEND value for blocking correct package. -# Usefull for file-collision blocks. -# Parameters are package and version to block. +# Useful for file-collision blocks. +# Parameters are package and version(s) to block. # add_blocker kdelibs 4.2.4 +# If no version is specified, then all versions will be blocked +# If any arguments (from 2 on) contain a ":", then different versions +# are blocked in different slots. (Unlisted slots get the version without +# a ":", if none, then all versions are blocked). The parameter is then of +# the form VERSION:SLOT. Any VERSION of 0 means that no blocker will be +# added for that slot (or, if no slot, then for any unlisted slot). +# A parameter of the form :SLOT means to block all versions from that slot. +# If VERSION begins with "<", then "!