/[gentoo-x86]/eclass/kde4-functions.eclass
Gentoo

Diff of /eclass/kde4-functions.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.23 Revision 1.24
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.23 2009/08/20 09:18:01 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.24 2009/09/01 09:32:08 scarabeus Exp $
4 4
5# Prefix compat: 5# Prefix compat:
6: ${EROOT:=${ROOT}} 6: ${EROOT:=${ROOT}}
7# Append missing trailing slash character 7# Append missing trailing slash character
8[[ ${EROOT} = */ ]] || EROOT+="/" 8[[ ${EROOT} = */ ]] || EROOT+="/"
42 42
43# @ECLASS-VARIABLE: KDE_SLOTS 43# @ECLASS-VARIABLE: KDE_SLOTS
44# @DESCRIPTION: 44# @DESCRIPTION:
45# The slots used by all KDE versions later than 4.0. The live KDE releases use 45# The slots used by all KDE versions later than 4.0. The live KDE releases use
46# KDE_LIVE_SLOTS instead. Values should be ordered. 46# KDE_LIVE_SLOTS instead. Values should be ordered.
47KDE_SLOTS=( "kde-4" "4.1" "4.2" "4.3" "4.4" ) 47KDE_SLOTS=( "4.1" "4.2" "4.3" "4.4" )
48 48
49# @ECLASS-VARIABLE: KDE_LIVE_SLOTS 49# @ECLASS-VARIABLE: KDE_LIVE_SLOTS
50# @DESCRIPTION: 50# @DESCRIPTION:
51# The slots used by KDE live versions. Values should be ordered. 51# The slots used by KDE live versions. Values should be ordered.
52KDE_LIVE_SLOTS=( "live" ) 52KDE_LIVE_SLOTS=( "live" )
53
54# @FUNCTION: slot_is_at_least
55# @USAGE: <want> <have>
56# @DESCRIPTION:
57# Version aware slot comparator.
58# Current implementation relies on the fact, that slots can be compared like
59# string literals (and let's keep it this way).
60slot_is_at_least() {
61 [[ "${2}" > "${1}" || "${2}" = "${1}" ]]
62}
53 63
54# @FUNCTION: buildsycoca 64# @FUNCTION: buildsycoca
55# @DESCRIPTION: 65# @DESCRIPTION:
56# Function to rebuild the KDE System Configuration Cache. 66# Function to rebuild the KDE System Configuration Cache.
57# All KDE ebuilds should run this in pkg_postinst and pkg_postrm. 67# All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
358# @FUNCTION: block_other_slots 368# @FUNCTION: block_other_slots
359# @DESCRIPTION: 369# @DESCRIPTION:
360# Create blocks for the current package in other slots when 370# Create blocks for the current package in other slots when
361# installed with USE=-kdeprefix 371# installed with USE=-kdeprefix
362block_other_slots() { 372block_other_slots() {
373 debug-print-function ${FUNCNAME} "$@"
374
363 local slot 375 local slot
364
365 debug-print-function ${FUNCNAME} "$@"
366
367 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do 376 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
368 # Block non kdeprefix ${PN} on other slots 377 # Block non kdeprefix ${PN} on other slots
369 if [[ ${SLOT} != ${slot} ]]; then 378 if [[ ${SLOT} != ${slot} ]]; then
370 echo "!kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] )" 379 echo "!kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] )"
371 fi 380 fi
377# Create correct RDEPEND value for blocking correct package. 386# Create correct RDEPEND value for blocking correct package.
378# Usefull for file-collision blocks. 387# Usefull for file-collision blocks.
379# Parameters are package and version to block. 388# Parameters are package and version to block.
380# add_blocker kde-base/kdelibs 4.2.4 389# add_blocker kde-base/kdelibs 4.2.4
381add_blocker() { 390add_blocker() {
391 debug-print-function ${FUNCNAME} "$@"
392
393 [[ ${1} = "" || ${2} = "" ]] && die "Missing parameter"
382 local slot 394 local slot
383
384 debug-print-function ${FUNCNAME} "$@"
385
386 [[ ${1} = "" || ${2} = "" ]] && die "Missing parameter"
387 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do 395 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
388 # on -kdeprefix we block every slot 396 # on -kdeprefix we block every slot
389 RDEPEND+=" !kdeprefix? ( !<=${1}-${2}:${slot}[-kdeprefix] )" 397 RDEPEND+=" !kdeprefix? ( !<=${1}-${2}:${slot}[-kdeprefix] )"
390 done 398 done
391 # on kdeprefix we block only our slot 399 # on kdeprefix we block only our slot

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.20